IonBadge in IonTabButton doesn't update

I am using Ionic React and am trying to add a IonBadge for a IonTabButton:

<IonTabButton tab="d" href="/chat">
                    <IonIcon icon={chatbubblesOutline} />
                    <IonText>Chats</IonText>
                    <IonBadge color="primary">{Number(unreadMessages)}</IonBadge>
<IonTabButton>

However, even when unreadMessages is updating, the badge number does not change. I have tried this behaviour with other components (not IonTab), and the badge count updates correctly. Any reason why IonBadge isn’t updating when wrapped in an IonTabButton?

Do you have a sample app or recreation we could look at? Hard to know for sure without one.