computerjazz / react-native-infinite-pager

An infinitely-swipeable pager component.
MIT License
174 stars 16 forks source link

Is there any way to set an initial page for it? #13

Open verger-guo opened 2 years ago

verger-guo commented 2 years ago

Is there any way to set an initial page for it? When I first render 0 pages and setPage(initPage), which causes the view to jump

michelecocuccio commented 1 year ago

👍 wondering the same thing. I have tried to do it but only thing I came up is an ugly useEffect, which results in a jumpy view yeah. I wonder if it possibile to set a param like startAtIndex or something. It will be really useful

ryskin commented 11 months ago

No way, use offset

computerjazz commented 10 months ago

just added initialIndex prop, please try https://github.com/computerjazz/react-native-infinite-pager/releases/tag/v0.3.11