|
|
@ -7,7 +7,7 @@ title: useReducer |
|
|
|
`useReducer` is a React Hook that lets you add a [reducer](/learn/extracting-state-logic-into-a-reducer) to your component. |
|
|
|
|
|
|
|
```js |
|
|
|
const [state, dispatch] = useReducer(reducer, initialArg, init) |
|
|
|
const [state, dispatch] = useReducer(reducer, initialArg, init?) |
|
|
|
``` |
|
|
|
|
|
|
|
</Intro> |
|
|
|