Thanks for sharing the failing experience and the lesson learned, DrKnoxy 👋
Hooks are great and sometimes being explicit about reading life cycle method names (cDM, cDU, cWU, etc).
From what I've learned React used to tell us what it was doing but the trend is that we devs are now responsible to tell what React should do
e.g.) componentDidMount -> React tells us what we are doing and we had to figure out how to use that lifecycle
useEffect -> We tell React what we want to do, and when.
So we are given a dangerous weapon and be careful of how to use it as mentioned in your post 😀
I think both are same in this regard. React let's us hook arbitrary code between it's render cycle. Before we assigned a function to cDM etc. and now we do it by passing a callback to useEffect
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.