loading...

re: Refactoring useState() To useReducer() VIEW POST

FULL DISCUSSION
 

Good article - but could you elaborate on why you would choose one over the other? Pros/cons ? Or is it just a "here's a React hook for you redux folks..." difference?

 

I decided to convert from useState() to useReducer() as useReducer() is more DRY and I believe will be easier for me to maintain and extend over time. Both approaches work so I think I'd leave it up to personal preference.

code of conduct - report abuse