I'm working on a plugin with Gutenberg integration. I registered a plugin in React, and my sidebar is showing and working fine. But I need to perform an action each time my sidebar is showing up.
I noticed that functions Render, componentDidUpdate, componentDidMount are not called when I switch the sidebar (for example I open Rank Math sidebar, and then I return to my sidebar). So using those are not good for me.
I'm looking for some kind of event listener that will be executed when I reopen my sidebar. I'm new to React, so I'm not sure if I can use useState hook in some way to do this?
Furthermore, I also field at looking for any built-in events in Gutenberg in documentation, so not sure if there is any ready solution.