grahammendick / navigation

Scene-Based Navigation for React and React Native
https://grahammendick.github.io/navigation/
Apache License 2.0
594 stars 41 forks source link

The tabbar icon only updates once #671

Closed RichardLindhout closed 1 year ago

RichardLindhout commented 1 year ago

I have the following code

  <TabBarItem
    key={tab.path}
    image={bottomTabIndex === index ? tab.selectedIcon : tab.icon}
   .........
  >

Source: https://github.com/web-ridge/react-native-ridge-navigation/blob/main/src/BottomTabsStack.tsx#L54

The image is only updated once and then it does not change anymore, I logged the image reference and all that still works so it seems to be a bug in the image component

https://user-images.githubusercontent.com/6492229/219367978-8d422974-bb72-4279-8ae6-e8885df1d8ff.mov

grahammendick commented 1 year ago

On native, typically you have a single icon per tab and let the platform take care of tinting it depending on whether the tab's selected or not. I wonder if perhaps the icon is being tinted differently the second time. It's hard to tell from the video. Please could you make another video and choose completely different icons for the selected and unselected states so it's easier to see what's happening?

RichardLindhout commented 1 year ago

The two right icons you can see they stick to the selected variant