2

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?

Siddharamesh
  • 83
  • 1
  • 12

1 Answers1

5

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

Anhdevit
  • 1,926
  • 2
  • 16
  • 29