wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

fix(ios): avoid setting selected-index before setup has finished. #7925

Closed asafkorem closed 1 month ago

asafkorem commented 1 month ago

This fixes the issue mentioned on #7921, #7922 and #7924.

This prevents the bug of loading of the tab from index 0 immediately after calling the super init regardless of the custom initial rendered tab. More specifically, the original issue was the method setSelectedIndex was called immediately when calling to the super initializer with a 0 value regardless of the initial currentTabIndex value.

After this fix, changing the selectedIndex with the non-initial value from options will not have any effect before the setup has finished.

asafkorem commented 1 month ago

Released with v7.40.3