React 19 · State and effects
Manage complex state with a reducer
Move state transitions into one function.
const [state, dispatch] = useReducer(reducer, { count: 0 });
dispatch({ type: "increment" });
Official React 19 documentation
React 19 · State and effects
Move state transitions into one function.
const [state, dispatch] = useReducer(reducer, { count: 0 });
dispatch({ type: "increment" });
Official React 19 documentation
Was this page helpful?