react-native-viewpager
react-native-viewpager copied to clipboard
bad performance
Hi, I'm trying to build dynamic viewer - that can have pages added or removed. I've set
var dataSource = new ViewPager.DataSource ({
pageHasChanged: ( p1, p2 ) => p1 !== p2
});
as a global var, and added
setState({dataSource: dataSource.cloneWithPages(this.state.pages)})
to initialState
and to add/removePage
methods.
while it is working - the performance of scrolling and adding pages is quite slow (fps around 30), making it a non-option.
I'm not sure what i'm doing wrong, sunce my renderPage
method is quite standard, and works fine (and smooth) with the native Components (ScrollView
and ViewPagerAndroid
).
+1 did you solve this? I have a simple view with the ViewPager only, which contain 3 images. Scrolling between pages is absolutely not smooth, and after 4/5 swipe/scroll the App freeze for seconds :/
just dropped this repo and using the native ScrollView
and ViewPagerAndroid
@yonatanmn here is a unified version for these two components, works great: https://github.com/zbtang/React-Native-ViewPager