react-native-viewpager icon indicating copy to clipboard operation
react-native-viewpager copied to clipboard

bad performance

Open yonatanmn opened this issue 8 years ago • 3 comments

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).

yonatanmn avatar Mar 08 '16 15:03 yonatanmn

+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 :/

KBLNY avatar Apr 27 '16 09:04 KBLNY

just dropped this repo and using the native ScrollView and ViewPagerAndroid

yonatanmn avatar Apr 27 '16 14:04 yonatanmn

@yonatanmn here is a unified version for these two components, works great: https://github.com/zbtang/React-Native-ViewPager

ms88privat avatar Apr 28 '16 08:04 ms88privat