Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: onTabChange called twice on Android (#1093)
`onPageSelected={this._updateSelectedPage}` ViewPager prop causes onTabChange to be called twice when change tabs without any gesture actions this will fix duplicated tab updates on android #### when user clicked tab buttons `goToPage -> updateSceneKeys(onTabChange) -> Screen Update -> onPageSelected={_updateSelectedPage} -> updateSceneKeys(onTabChange) -> Screen Update` #### when user swiped tab views `Swipe -> onPageSelected={_updateSelectedPage} -> updateSceneKeys(onTabChange) -> Screen Update` #### when user clicked tab buttons with this patch `goToPage -> set tabWillChangeWithoutGesture -> updateSceneKeys(onTabChange) -> Screen Update -> onPageSelected={_updateSelectedPage} -> ignore updateSceneKeys(onTabChange) -> remove tabWillChangeWithoutGesture`
- Loading branch information