mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Remove deprecated PullToRefreshViewAndroid and onRefreshStart / endRefreshing
Summary: Removes the deprecated APIs that were replaced by `RefreshControl`. Those API have been deprecated for a while already so I think it's fine to remove them at this point. Also ported the `SwipeRefreshLayoutTestModule` test to use `RefreshControl` instead of `PullToRefreshViewAndroid`. **Test plan (required)** Made sure no references are left in the codebase to `PullToRefreshViewAndroid`, `onRefreshStart` and `endRefreshing`. Tested that `ScrollView` examples in UIExplorer still work properly. Check that the `SwipeRefreshLayoutTestModule` passes on CI. Closes https://github.com/facebook/react-native/pull/7447 Reviewed By: mkonicek Differential Revision: D3292391 Pulled By: bestander fbshipit-source-id: 27eb2443861e04a9f7319586ce2ada381b714d47
This commit is contained in:
committed by
Facebook Github Bot 1
parent
18d6d85320
commit
a71a9efe96
@@ -24,7 +24,6 @@ const StyleSheetPropType = require('StyleSheetPropType');
|
||||
const View = require('View');
|
||||
const ViewStylePropTypes = require('ViewStylePropTypes');
|
||||
|
||||
const deprecatedPropType = require('deprecatedPropType');
|
||||
const dismissKeyboard = require('dismissKeyboard');
|
||||
const flattenStyle = require('flattenStyle');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
@@ -311,14 +310,6 @@ const ScrollView = React.createClass({
|
||||
*/
|
||||
refreshControl: PropTypes.element,
|
||||
|
||||
/**
|
||||
* @platform ios
|
||||
*/
|
||||
onRefreshStart: deprecatedPropType(
|
||||
PropTypes.func,
|
||||
'Use the `refreshControl` prop instead.'
|
||||
),
|
||||
|
||||
/**
|
||||
* Sometimes a scrollview takes up more space than its content fills. When this is
|
||||
* the case, this prop will fill the rest of the scrollview with a color to avoid setting
|
||||
@@ -348,15 +339,6 @@ const ScrollView = React.createClass({
|
||||
this._scrollViewRef && this._scrollViewRef.setNativeProps(props);
|
||||
},
|
||||
|
||||
/**
|
||||
* Deprecated. Use `RefreshControl` instead.
|
||||
*/
|
||||
endRefreshing: function() {
|
||||
RCTScrollViewManager.endRefreshing(
|
||||
ReactNative.findNodeHandle(this)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a reference to the underlying scroll responder, which supports
|
||||
* operations like `scrollTo`. All ScrollView-like components should
|
||||
@@ -510,14 +492,6 @@ const ScrollView = React.createClass({
|
||||
sendMomentumEvents: (this.props.onMomentumScrollBegin || this.props.onMomentumScrollEnd) ? true : false,
|
||||
};
|
||||
|
||||
const onRefreshStart = this.props.onRefreshStart;
|
||||
if (onRefreshStart) {
|
||||
// this is necessary because if we set it on props, even when empty,
|
||||
// it'll trigger the default pull-to-refresh behavior on native.
|
||||
props.onRefreshStart =
|
||||
function() { onRefreshStart && onRefreshStart(this.endRefreshing); }.bind(this);
|
||||
}
|
||||
|
||||
const { decelerationRate } = this.props;
|
||||
if (decelerationRate) {
|
||||
props.decelerationRate = processDecelerationRate(decelerationRate);
|
||||
|
||||
Reference in New Issue
Block a user