Read the React Hooks docs (again)

twitter logo github logo ・1 min read

I was reading the React Hooks docs again yesterday and noticed that they've improved since the last time I reviewed them. I get a lot of questions from people about React Hooks, (and understandably so, there's a bit of a learning curve) and so many of the questions are answered in the React Hooks documentation (especially the FAQ) or by searching "hook" on my blog.

So if it's been a while, give the docs another look. You'll definitely learn something new! Then come back here and comment on what it was you learned 😉 let's learn together.

twitter logo DISCUSS (10)
markdown guide
 

Resources that settled it for me: (in order of discovery)

  1. reactjs.org/docs/hooks-faq.html (covers most edge cases and recommendations)
  2. overreacted.io/a-complete-guide-to... (covers philosophy behind hooks, and a lot of tasty tips, had to reread like 5 times until it "clicked" )
  3. github.com/facebook/react/blob/mas... (for everything else, thanks to the react team it's incredibly readable)

^ covers 99.9% of all use cases for me, including edge cases every time.

 
 

I definitely had to reread them. Critical to helping me refactor and work out the hooks linting issues that came up when I upgraded to Scripts 3.0...I thought I understood hooks pretty well... Not as well as I thought and not as well as I do now.

 
 

So if it's been a while, give the docs another look. You'll definitely learn something new!

You're right!

When hooks first came out, it was this mysterious new thing everyone was trying to explain in different ways. Things have become more coherent since then.

 

Yep!

My team had a meeting about hooks the other day and I re-read the docs beforehand. It was well worth it!

Also, hi Kent 👋

 
 

I'm observer mode on this topic.
Heard, never tried, wondering about. probably wait for it to get become more popular(=> more resource) and stable(=> less possible trouble).

 
 

Did I said "thanks in advance"? I'll say it again anyway.😉Looking forward.

Classic DEV Post from Apr 1

How I Write Online Articles

How you can write online articles

Kent C. Dodds profile image
My name is Kent C. Dodds and I'm a JavaScript engineer and teacher. I'm also active in the open source community. I like my family, JavaScript, and React.