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:
einarq
2018-11-05 16:53:23 +01:00
committed by Dan Abramov
parent 6b1fd7d984
commit d7fc875f71

View File

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