web-ridge / react-native-paper-tabs

Smooth and fast cross platform Material Design Tabs for React Native Paper
https://reactnativepapertabs.com
MIT License
201 stars 36 forks source link

Fix infinite tab switching issue in Swiper.native component #76

Closed NewmarLucas closed 3 weeks ago

NewmarLucas commented 3 weeks ago

Prevent unnecessary calls to goTo function when switching tabs. This resolves the infinite loop of tab changes that occurred due to simultaneous interactions between the TabsHeaderItem and the Swiper.native.

NewmarLucas commented 3 weeks ago

When switching tabs using the header, the swiper is also triggered, causing the goTo function to be called twice. When rapidly switching tabs through the header multiple times, there comes a point where the swiper starts calling goTo continuously, resulting in an infinite loop. This PR prevents the swiper from triggering goTo when the tab is changed via the header.