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
This commit is contained in:
Dustin Hoffner 2016-09-22 13:44:27 -07:00 коммит произвёл Facebook Github Bot 6
Родитель 858e95b2aa
Коммит 727b7dffb4
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -390,7 +390,7 @@ const ScrollView = React.createClass({
_handleScroll: function(e: Object) { _handleScroll: function(e: Object) {
if (__DEV__) { 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 console.log( // eslint-disable-line no-console-disallow
'You specified `onScroll` on a <ScrollView> but not ' + 'You specified `onScroll` on a <ScrollView> but not ' +
'`scrollEventThrottle`. You will only receive one event. ' + '`scrollEventThrottle`. You will only receive one event. ' +