Browse Source

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
main
einarq 6 years ago
committed by Dan Abramov
parent
commit
d7fc875f71
  1. 2
      content/docs/hooks-reference.md

2
content/docs/hooks-reference.md

@ -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}

Loading…
Cancel
Save