Did you know your browser comes with an event bus that you can start using today for free?
I've created a small demo of how
you can leverage this in your React project to simplify inter-component
communication without the need for global state management. The demo also shows
how you can leverage the <dialog>
tag to create modal dialogs.
Since the code contains extensive comments that describe how it works and why, I won't bore you with the details. Hopefully, this will also give you a hint about the importance of knowing the vanilla DOM API. It simplifies the code quite a bit even when you're stuck using React (and most other frameworks).