News for hackers. Stuff that matters.
Re:Introducing react.dev by leeoniya on Thursday March 16, 2023 @04:46PM (#35188305)
i've seen advice on the webs for useReducer instead of a lot of useState's...which feels a lot closer to the class-component this.setState().

is there a good reason not to uniformly rely on useReducer everywhere in a codebase?

Re:Introducing react.dev by Marazan on Thursday March 16, 2023 @05:30PM (#35188964)
Because you have to write more code. If all you have is a single variable that gets updated with no complex logic then writing a reducer seems excessively boilerplatey.