DEV Community

How to be a better react Developer.

Suraj Auwal on April 13, 2020

Hi everyone! I hope you're safe and good. I want to talk about something different today. I want to share some tips and strategies that will help...
Collapse
 
andrewrothman profile image
Andrew Rothman

Great writeup. I haven't seen prop-types used for a while, but that might just be because I use TypeScript. Other than that, I agree with all of the points. Especially the point about hooks and when to refactor to them. They're awesome.

Collapse
 
siradji profile image
Suraj Auwal

Thanks Andrew. I've heard great things about using typescript with react, but I am yet to try it.

Collapse
 
alexgurr profile image
Alex Gurr • Edited

You went straight from 1 to 3 😊 all of this is pretty good. Would disagree that functional components are the future. I see so many people talk about hooks over classes. It all depends on the situation and the complexity of the component. Ever seen a complex component or something like a form with hooks? Awful. Messy. Impossible to follow.

Collapse
 
siradji profile image
Suraj Auwal

Lol I haven't seen that. Thanks for pointing out.

I don't know understand what you mean by complex component. In context of form, I don't see how classes with be more beneficial than functional component.
I think it all depends on preference and like you said, situation.

Collapse
 
itsjzt profile image
Saurabh Sharma

Using eslint and prettier can be added but that would be "the way" for most of people

Collapse
 
avxkim profile image
Alexander Kim

How to be a better react Developer.

Just remove it and use web components.

Collapse
 
siradji profile image
Suraj Auwal

Pardon?

Collapse
 
capsule profile image
Thibaut Allender

Although that was a semi sarcastic comment, the reply tells a lot. "Become a better react developer by ignoring anything that is not react"? One true react dev would have argued why web components might not be a good alternative solution.

Thread Thread
 
siradji profile image
Suraj Auwal

If he's something to say, why the sarcasm? I am sorry for not getting his sarcasm.

Collapse
 
gndx profile image
Oscar Barajas Tavares

Amazing!

Collapse
 
siradji profile image
Suraj Auwal

I am glad you liked it. Thanks.

Collapse
 
andripurnama66 profile image
andripurnama66

Good article. This answered my question about why and when i should use class component based and function component based. I hope you write next about function component and advanced hooks use. πŸ‘

Collapse
 
koichadev profile image
Khoi Hoang

How is hooks compared to using a Redux for example?

Collapse
 
mapleleaf profile image
MapleLeaf

Hooks and redux aren't alternatives, they work together. Redux even comes with hooks: react-redux.js.org/api/hooks

Though a lot of apps that use Redux might not need it to begin with: simplethread.com/cant-replace-redu...