medium10 pts · first answer countsreacthooksstate
When to reach for useReducer
A checkout form has 8 related fields and actions like ADD_ITEM, APPLY_COUPON and RESET. Why might useReducer fit better than many useState calls?
Discussion 0
Join free to post in the discussion.
Related questions
- Why React lists need keysFrontend Developer
- Input that ignores typingFrontend Developer
- Changing a prop inside a childFrontend Developer
- What JSX turns intoFrontend Developer
- A component written in lowercaseFrontend Developer
- Adding a CSS class in JSXFrontend Developer
- Returning two elementsFrontend Developer
- A stray 0 on the pageFrontend Developer