From 727b7dffb4aa5ef2bbfa5d407420a85084732870 Mon Sep 17 00:00:00 2001 From: Dustin Hoffner Date: Thu, 22 Sep 2016 13:44:27 -0700 Subject: [PATCH] Changed scrollEventThrottle check Summary: Hi there, when using the ScrollView component with `onScroll` and `scrollEventThrottle = 0` as it is documented in [react-native/docs/scrollview](https://facebook.github.io/react-native/docs/scrollview.html#scrolleventthrottle) this message will appear unnecessary. This happens because `!this.props.scrollEventThrottle` is `true` when the value is `0`. So I changed it to `this.props.scrollEventThrottle == null`. Now it is `false` when the value is `0`. Closes https://github.com/facebook/react-native/pull/10038 Differential Revision: D3909323 fbshipit-source-id: 3c701f23708b64576a8c9f47e140d87159087894 --- Libraries/Components/ScrollView/ScrollView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index f96b2d93aea..342c414cdb8 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -390,7 +390,7 @@ const ScrollView = React.createClass({ _handleScroll: function(e: Object) { if (__DEV__) { - if (this.props.onScroll && !this.props.scrollEventThrottle && Platform.OS === 'ios') { + if (this.props.onScroll && this.props.scrollEventThrottle == null && Platform.OS === 'ios') { console.log( // eslint-disable-line no-console-disallow 'You specified `onScroll` on a but not ' + '`scrollEventThrottle`. You will only receive one event. ' +