React-native-pager-view: Perfomance and memory

Created on 26 Jul 2020  路  4Comments  路  Source: callstack/react-native-pager-view

Question

I need to show a 100 pages (some text, image and a few buttons on each) in some cases so I'm wondering about possible performance issues. Android implementation using ViewPager2 (with recyclerview underneath) which seems like a good fit for the task. Could react-native-viewpager handle a 100 pages or should I use something else (maybe native?) for that?

question

All 4 comments

Hey @olhapi
Currently,ViewPager does not support lazy loading on JS side (https://github.com/react-native-community/react-native-viewpager/issues/104). As you mentioned, native side is prepared for it, but the problem is with JS implementation.

All views will be initialized in memory eagerly (View should be created, if needed in lazy way). In above issue, there is some PoC, how it can be implemented. You can try to tweak a JS part to support lazy loading. In case of any help, feel free to ask.

should I use something else (maybe native?) for that?

Depends on feature, you need to implement. Probably you can use FlatList, which support lazy loading.

For native implementation you can try for ios

Hello @troZee. I'm just diving in the react native world and not ready to mess with what I don't know but rather pick something created by experienced developers. Thanks for the answer.

@troZee great news. Thanks for letting me know.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Andarius picture Andarius  路  5Comments

KingAmo picture KingAmo  路  9Comments

yashspr picture yashspr  路  5Comments

troZee picture troZee  路  3Comments

ferrannp picture ferrannp  路  10Comments