mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 07:35:25 +00:00
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:
parent
858e95b2aa
commit
727b7dffb4
@ -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 <ScrollView> but not ' +
|
||||
'`scrollEventThrottle`. You will only receive one event. ' +
|
||||
|
Loading…
x
Reference in New Issue
Block a user