diff --git a/index.js b/index.js index dc9d4f4e..25f23b69 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ const { const ViewPagerAndroid = require('@react-native-community/viewpager'); const TimerMixin = require('react-timer-mixin'); -const ViewPager = require('@react-native-community/viewpager'); +const ViewPager = require('react-native-pager-view').default; const SceneComponent = require('./SceneComponent'); const DefaultTabBar = require('./DefaultTabBar'); @@ -138,15 +138,15 @@ const ScrollableTabView = createReactClass({ if (Platform.OS === 'ios') { const offset = pageNumber * this.state.containerWidth; if (this.scrollView) { - this.scrollView.scrollTo({x: offset, y: 0, animated: !this.props.scrollWithoutAnimation, }); + this.scrollView.getNode().scrollTo({x: offset, y: 0, animated: !this.props.scrollWithoutAnimation, }); } } else { if (this.scrollView) { this.tabWillChangeWithoutGesture = true; if (this.props.scrollWithoutAnimation) { - this.scrollView.setPageWithoutAnimation(pageNumber); + this.scrollView.getNode().setPageWithoutAnimation(pageNumber); } else { - this.scrollView.setPage(pageNumber); + this.scrollView.getNode().setPage(pageNumber); } } } diff --git a/package.json b/package.json index ef9b36af..0fe4f238 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/brentvatne/react-native-scrollable-tab-view#readme", "dependencies": { - "@react-native-community/viewpager": "3.3.0", + "react-native-pager-view": "^6.3.1", "create-react-class": "^15.6.2", "deprecated-react-native-prop-types": "^2.3.0", "prop-types": "^15.6.0",