From d7fc875f71d6c2351d3e53af43b684ef17d404bd Mon Sep 17 00:00:00 2001 From: einarq Date: Mon, 5 Nov 2018 16:53:23 +0100 Subject: [PATCH] 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 --- content/docs/hooks-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/hooks-reference.md b/content/docs/hooks-reference.md index afc3d373..db93175b 100644 --- a/content/docs/hooks-reference.md +++ b/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}