callstack / react-native-pager-view

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

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

Open TallNutAlt opened 1 month ago

TallNutAlt commented 1 month 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 1 month ago

650

similar