mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
Updates from Fri Feb 13
- [ReactNative] Fix throttle warning and warn in callback instead of render | Christopher Chedeau - [react-packager][streamline oss] Remove react-page-middleware | Amjad Masad - [ReactNative] Turn on perf measurement around a group feed load | Jing Chen - Implemented Layout animations | Nick Lockwood - [ReactNative] Revert D1815137 - avoid dropping touch start on missing target | Eric Vicenti - Moved RKPOPAnimationManager into FBReactKitComponents | Nick Lockwood - Extracted RKAnimationManager | Nick Lockwood
This commit is contained in:
@@ -25,7 +25,6 @@ var invariant = require('invariant');
|
||||
var merge = require('merge');
|
||||
var nativePropType = require('nativePropType');
|
||||
var validAttributesFromPropTypes = require('validAttributesFromPropTypes');
|
||||
var warning = require('warning');
|
||||
|
||||
var PropTypes = React.PropTypes;
|
||||
|
||||
@@ -194,14 +193,19 @@ var ScrollView = React.createClass({
|
||||
);
|
||||
}
|
||||
if (__DEV__) {
|
||||
warning(
|
||||
this.props.onScroll && !this.props.throttleScrollCallbackMS,
|
||||
'You specified `onScroll` on a <ScrollView> but not ' +
|
||||
'`throttleScrollCallbackMS`. You will only receive one event. ' +
|
||||
'Using `16` you get all the events but be aware that it may cause ' +
|
||||
'frame drops, use a bigger number if you don\'t need as much ' +
|
||||
'precision.'
|
||||
);
|
||||
if (this.props.onScroll && !this.props.throttleScrollCallbackMS) {
|
||||
var onScroll = this.props.onScroll;
|
||||
this.props.onScroll = function() {
|
||||
console.log(
|
||||
'You specified `onScroll` on a <ScrollView> but not ' +
|
||||
'`throttleScrollCallbackMS`. You will only receive one event. ' +
|
||||
'Using `16` you get all the events but be aware that it may ' +
|
||||
'cause frame drops, use a bigger number if you don\'t need as ' +
|
||||
'much precision.'
|
||||
);
|
||||
onScroll.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var contentContainer =
|
||||
|
||||
Reference in New Issue
Block a user