top | item 35271240

(no title)

aeroaero | 2 years ago

This page should be mandatory reading for any dev working in react. The biggest mistake I see with devs of all levels is over use of effects.

This seems to be especially bad for anyone who originally worked with class components. The mental modal shift was large and people tried to fit their understanding of lifecycle methods into hooks, attempting to replicate similar behaviour. The docs at the time did a poor job of explaining why this was a bad idea.

discuss

order

brundolf|2 years ago

100%. Effects are an escape-hatch, and it's really common for people not to treat them that way. All of the new docs are gold, but if I could only pick one to recommend that every React developer read, it would be this one

cjonas|2 years ago

Second is abuse of useState for calculated values