diff --git a/package.json b/package.json index 4119d541..c1a84554 100644 --- a/package.json +++ b/package.json @@ -32,5 +32,8 @@ "bugs": { "url": "https://github.com/zbtang/React-Native-ViewPager/issues" }, - "homepage": "https://github.com/zbtang/React-Native-ViewPager#readme" + "homepage": "https://github.com/zbtang/React-Native-ViewPager#readme", + "dependencies": { + "@react-native-community/viewpager": "^1.1.7" + } } diff --git a/viewpager/ViewPager.js b/viewpager/ViewPager.js index 732db756..eee7d3c4 100644 --- a/viewpager/ViewPager.js +++ b/viewpager/ViewPager.js @@ -4,7 +4,8 @@ 'use strict' -import { PanResponder, Platform, ScrollView, StyleSheet, View, ViewPagerAndroid } from 'react-native' +import { PanResponder, Platform, ScrollView, View } from 'react-native' +import RNCViewPager from '@react-native-community/viewpager'; import React, { Component } from 'react' const SCROLLVIEW_REF = 'scrollView' @@ -16,7 +17,7 @@ const SCROLL_STATE = { dragging: 'dragging' } export default class ViewPager extends Component { - static propTypes = {...ViewPagerAndroid.propTypes} + static propTypes = {...RNCViewPager.propTypes} static defaultProps = { initialPage: 0, @@ -59,7 +60,7 @@ export default class ViewPager extends Component { render () { return (this.props.forceScrollView || Platform.OS === 'ios') ? this._renderOnIOS() : ( -