Reputation: 93
To display notifications badge, I found out I can use tabBarBadge from react-navigation. tabBarBadge accepts only a number or a string and not a function, so I couldn't figure out a way to disable it when the user is focused on the notifications screen. How can I disable it?
In the tabBarIcon there is tabInfo.focused that lets us know when the user is on this screen. Is there a similar method for tabBarBadge?
Upvotes: 2
Views: 2179
Reputation: 2104
when when the user is focused on the notifications screen set tabBarBadge: null
Upvotes: 5