Skip to content

Commit d3f1248

Browse files
authored
Added this.props.onScroll null check
The check must be done because `typeof null` is also `object`.
1 parent 7fd8ee4 commit d3f1248

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/SwipeListView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SwipeListView extends PureComponent {
3232
};
3333
}
3434
this._onScroll = this.onScroll.bind(this);
35-
if (typeof this.props.onScroll === 'object') {
35+
if (this.props.onScroll && typeof this.props.onScroll === 'object') {
3636
// Animated.event
3737
this.props.onScroll.__addListener(this._onScroll);
3838
this._onScroll = this.props.onScroll;

0 commit comments

Comments
 (0)