DEV Community

Discussion on: React should change the documentation to React Hooks

Collapse
 
thebearingedge profile image
Tim Davis • Edited

I'm curious about which you learned first? I've never met a new react dev that didn't need a lot of hand holding when going straight to hooks. Admittedly anecdata, but myself and several friends who took on mentees have experienced this. In the cases when I was asked which I teach first and responded "classes", it was meet with surprise. A few weeks later I got reports that mentees could not use hooks properly within a few days but when"downgraded" to classes finally got traction.

Hooks are fine, but they are magical. Nothing about them makes react more "functional".

I used to say that React to rewarded strong JavaScript fundamentals whereas something like Angular demanded framework expertise. Hooks ended that.

Will I use hooks? Yes. Will I teach hooks? Eventually. But they are a pedagogical nightmare.

Collapse
 
ivan_jrmc profile image
Ivan Jeremic

Class components are horrible trust me there is no magic in hooks, It just makes sense and I'm happy we have them.

Collapse
 
thebearingedge profile image
Tim Davis

I've no need to trust you, homie. I'm also happy for you and your amazing journey.

Thread Thread
 
ivan_jrmc profile image
Ivan Jeremic

You don't need to trust me, trust the people building React.

Thread Thread
 
thebearingedge profile image
Tim Davis

Think for yourself.

Collapse
 
alesbe profile image
alesbe • Edited

I learnt functional components first (and then hooks). To be honest, I didn't need to use classes since I started with react, maybe because I didn't had to work with a relatively old react project.

In my case I self-taught react, it was my first JS framework, and I tried to learn using react docs, but encounter a lot of confusion because I didn't know which component style should I use, because functional components were relatively new, but every example was made using class components, but at the same time every react project made since then was made using functional components (or at least every project that I encounter), so I had a bit of confusion.

At the end, I ended up learning using other resources because the official documentation was so confusing at that moment, maybe because the hooks update was relatively new.

Finally, React decided to develop a beta version of the docs, that version will replace the actual one with purely functional components and hooks, and the current one will be moved into a "legacy" version, but not the official one.

It's been 4 years since the update came out, and being a framework created by Meta (Facebook) I don't really understand why they didn't change the docs already.

It's just my own experience! Maybe some people didn't have any issues at all!

Collapse
 
thebearingedge profile image
Tim Davis

Ok that all makes sense thanks for sharing 👍