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 😀
Web Developer currently experienced in JavaScript, React, Node.js but interested to learn multiple technologies and not stick to dead ones.
Specialization- Building high performance SPAs.
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
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.
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 lifecycleuseEffect
-> 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