Refresh MenuBar


I have a function that is common to both the page and the bar menu and I would like that when the user clicks on the page button the bar menu button changes.

I’m not sure how to do this while staying clean, send information to another page to tell it to use the function? or refresh permanently? or any other solution

Thanks for helping me get a cleaner idea of the thing.

See Lifting State Up in the React docs.

Here are to simple examples for managing state between tabs

thank you for your response

I start with this <IonButton onClick={(e) => teste()}>Teste</IonButton> in page.tsx
The function send true in my api

In app.tsx (Menu bar) I call the function to receive the variable but it does not refresh

So i try your recommandation