News for hackers. Stuff that matters.
Re:React: You Might Not Need an Effect by schwartzworld on Thursday March 23, 2023 @01:01PM (#35277736)
The problem is that React was designed to allow you to use functional programming to express a UI that is a function of state. It might be obvious to experienced functional programmers not to sync internal state using effects in this way, in no small part because they understand what a side effect is already.

> dependency list

This, again, is only confusing if you don't understand what an effect is for: syncing with systems external to React. How else would you say "do the thing when any of these change"?

> order of hooks

I never understood why this was confusing for people. It takes 2 seconds to learn this rule, and your browser console will yell at you if you violate it.

There are no comments on this comment yet.