DEV Community

Discussion on: Have React hooks replaced class lifecycle methods 🤔?

Collapse
 
s_aitchison profile image
Suzanne Aitchison

I think the official React docs explicitly say they encourage devs to start using hooks going forward, but as far as I know there's no plan to deprecate class components and the older way to manage lifecycle events.

I wouldn't be surprised if the React docs start to reflect that more and more eg in code examples, with hooks being the default implementation shown

Collapse
 
supunkavinda profile image
Supun Kavinda

Yes, I was confused because the React Hooks introduction encourages React hooks, but the documentation mostly includes code with class components. Is this because React hooks are new? But, it was 2018 when hooks were introduced, according to Google.

Collapse
 
s_aitchison profile image
Suzanne Aitchison

I've only seen companies start to adopt hooks in the last year really, and a lot haven't adopted them at all yet. I reckon we'll start to see the docs catching up to the new "normal" sometime this year 🔮