Javascript – Is it bad practice to make useEffect respond to an user action like this?
In the following code, I wanted to put all the collapsible logic into the Collapsible component. However, the collapse is being triggered by a button that's outside of Collapsible. So I made Collapsible to react to that button's onClick. For…