News for hackers. Stuff that matters.
Re:React: You Might Not Need an Effect by aeroaero on Thursday March 23, 2023 @02:48AM (#35271240)
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.

Re:React: You Might Not Need an Effect by brundolf on Thursday March 23, 2023 @02:51AM (#35271268)
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
Re:React: You Might Not Need an Effect by cjonas on Thursday March 23, 2023 @02:56AM (#35271301)
Second is abuse of useState for calculated values