How to synchronize button text of buttons under different tab in react?

I have a component with a button. The component is created in its parent component twice (under different tabs). If the user clicks the button, the button text will change. I hope the button texts are always the same whatever button is clicked and changed.
I have tried updating the state of the course component in click functions, so the text of the button can be changed based on the state condition. It doesn’t work. I guess the click function just updates the state of a component of one tab rather than another tab. Any way to implement the synchronization? Thanks!