mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-22 11:52:00 +00:00
Typo in useReducer docs, the initialCount prop is unused (#1376)
* Typo in useReducer docs, the initialCount prop is unused, should be passed to the useReducer hook as initial state * Fix example
This commit is contained in:
@@ -194,7 +194,7 @@ function reducer(state, action) {
|
||||
}
|
||||
|
||||
function Counter({initialCount}) {
|
||||
const [state, dispatch] = useReducer(reducer, initialState);
|
||||
const [state, dispatch] = useReducer(reducer, {count: initialCount});
|
||||
return (
|
||||
<>
|
||||
Count: {state.count}
|
||||
|
||||
Reference in New Issue
Block a user