3 ms·
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 r
by leeoniya 4y ago
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?
- Marazan 4y agoBecause 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.