Manage more structured state transitions.
Section: State Hooks
useReducer basic reducer
tsx
tsx
const [state, dispatch] = useReducer(reducer, initialState);Explanation
`useReducer` is useful when state transitions are more complex or action-driven.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing State Hooks