callstack / react-native-pager-view

React Native wrapper for the Android ViewPager and iOS UIPageViewController.
MIT License
2.69k stars 414 forks source link

When switching tab pages, onPageSelected always executes once and the passed e.nativeEvent-position is 0 #888

Open TallNutAlt opened 4 hours ago

TallNutAlt commented 4 hours ago

<PagerView ref={pageViewRef} initialPage={pageViewRefIndex.current} offscreenPageLimit={1} onPageSelected={e => handlePageSelected(e)}

    HandlePageSelected is always executed every time the page is switched, and passing an index of 0 results in the inability to retain the state of an option selected by the tab user

image If it always remains 0 after switching

TallNutAlt commented 4 hours ago

650

similar