Skip to content

Commit ac68ced

Browse files
author
victor0x16
authored
example should import useReducer (#4504)
1 parent b099d55 commit ac68ced

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beta/src/pages/apis/usereducer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const [state, dispatch] = useReducer(reducer, initialArg, init)
3636
Call `useReducer` at the top level of your component to manage state with a [reducer](/learn/extracting-state-logic-into-a-reducer).
3737

3838
```js [[1, 8, "state"], [2, 8, "dispatch"], [4, 8, "reducer"], [3, 8, "{ age: 42 }"]]
39-
import { useState } from 'react';
39+
import { useReducer } from 'react';
4040

4141
function reducer(state, action) {
4242
// ...

0 commit comments

Comments
 (0)