How to disable tabBarBadge in navigation v5 createbottomtabNavigator?

Viewed 1436

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?

enter image description here

enter image description here

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?

1 Answers

when when the user is focused on the notifications screen set tabBarBadge: null

Related