Skip to content

Commit

Permalink
Fixes missing state variable for numColumns prop
Browse files Browse the repository at this point in the history
Error message
```
G:\Build A Company\LOOPOUT\loopout-mobile-app\node_modules\react-native\Libraries\Core\ExceptionsManager.js:179 TypeError: Cannot set property 'gifSize' of undefined

This error is located at:
    in GifSearch
```
  • Loading branch information
devautor authored Feb 28, 2021
1 parent ef9b483 commit cdbdf23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/GifSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class GifSearch extends PureComponent {
if (props.numColumns != null) {
this.numColumns = props.numColumns;
this.horizontal = false;
this.state.gifSize = Dimensions.get('window').width / this.numColumns - 20;
this.gifSize = Dimensions.get('window').width / this.numColumns - 20;
}
this.provider = providers.ALL;
if (props.provider != null) {
Expand Down Expand Up @@ -136,6 +136,7 @@ class GifSearch extends PureComponent {
gifsOver: false,
noGifsFound: false,
next: 0,
gifSize: this.gifSize,
}

}
Expand Down

0 comments on commit cdbdf23

Please sign in to comment.