Most state like the content of input fields or whether a modal is open, is only interesting to the component that contains them!
I wonder why modals should be a good example for that, being kind of "global" in their very nature. Just imagine having two components with custom pop-overs, contained in a third component. If you only want to allow one pop-over to be open at any time, your third component would need to include handler-logic, although it's a separate concern.
I agree that the developer experience for state management could be better though, and hooks really help in that direction, independent of the library.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I wonder why modals should be a good example for that, being kind of "global" in their very nature. Just imagine having two components with custom pop-overs, contained in a third component. If you only want to allow one pop-over to be open at any time, your third component would need to include handler-logic, although it's a separate concern.
I agree that the developer experience for state management could be better though, and hooks really help in that direction, independent of the library.