Nice explanation! The mysterious part to me is where is the state kept when using useState, if not in the function and not in a class instance... 😎
useState
🧁🍨 Mark Dalgleish @markdalgleish "With hooks, beginners no longer need to learn about 'this' to avoid shooting themselves in the foot."Closures: 18:23 PM - 11 Feb 2019
this is one of the hardest concepts of javascript for some reason. Getting slightly off-topic here.
this
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Nice explanation! The mysterious part to me is where is the state kept when using
useState
, if not in the function and not in a class instance... 😎Deep dive: How do React hooks really work? was the version of the article I meant to link to.
this
is one of the hardest concepts of javascript for some reason. Getting slightly off-topic here.