Top 7 Mistakes to Avoid When Using React | Revive Coding

in react •  2 years ago 

Today we will take a look at the 7 most common mistakes that most React developers make. At the beginning of a career, each newbie has to overcome troubles and obstacles. It brings an enormous number of advantages for both, customers and developers if they improve their coding skills at the very beginning of their carrier...

TIMESTAMPS
0:00 Introduction to mistake done by react developer.
1:37 Absence of micro-services Mistake no 1.
3:50 Direct modification of states Mistakes no 2.
7:10 String instead of a number as the argument Mistake no 3.
9:04 SetState() is asynchronous Mistake no 4.
12:25 Components name capitalization Mistake no 5.
13:54 Folders are a total mess Mistake no 6.
16:14 Pack all UI elements into one component Mistake no 7
17:24 Thank You, like subscribe share.

Some common mistakes in React development you should avoid.

  • When rendering the list, do not use the key.
  • Modify the state value directly by assignment.
  • Bind the state value directly to the value property of the input.
  • Use state directly after executing setState.
  • Infinite loop when using useState + useEffect.
  • Don't pass state variables to setState in React. ...
  • Make your React components single responsibility. ...
  • Make your side effects single responsibility. ...
  • Use ternaries instead of && in JSX.
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!