Skip to content

Commit 0438e6d

Browse files
committed
fix android error
1 parent eaa402f commit 0438e6d

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

MJRefresh.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import {
77
ViewPropTypes,
88
findNodeHandle,
99
UIManager,
10+
ScrollView as NativeScrollView,
11+
Platform,
1012
} from 'react-native';
1113
import PropTypes from 'prop-types'
14+
import MJScrollView from './MJScrollView'
1215

1316
const RCTMJRefreshView = requireNativeComponent('RCTMJRefreshView', MJRefresh);
1417

@@ -69,5 +72,5 @@ MJRefresh.propTypes={
6972
onPulling:PropTypes.func,
7073
...ViewPropTypes
7174
}
72-
export {default as ScrollView} from './MJScrollView'
75+
export const ScrollView = Platform.OS === 'ios' ? MJScrollView : NativeScrollView;
7376
export default MJRefresh;

MJScrollView.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -920,24 +920,7 @@ let nativeOnlyProps,
920920
RCTScrollView,
921921
RCTScrollContentView;
922922
if (Platform.OS === 'android') {
923-
nativeOnlyProps = {
924-
nativeOnly: {
925-
sendMomentumEvents: true,
926-
}
927-
};
928-
AndroidScrollView = requireNativeComponent(
929-
'RCTScrollView',
930-
(ScrollView: React.ComponentType<any>),
931-
nativeOnlyProps
932-
);
933-
AndroidHorizontalScrollView = requireNativeComponent(
934-
'AndroidHorizontalScrollView',
935-
(ScrollView: React.ComponentType<any>),
936-
nativeOnlyProps
937-
);
938-
AndroidHorizontalScrollContentView = requireNativeComponent(
939-
'AndroidHorizontalScrollContentView'
940-
);
923+
941924
} else if (Platform.OS === 'ios') {
942925
nativeOnlyProps = {
943926
nativeOnly: {

0 commit comments

Comments
 (0)