Skip to content

Commit

Permalink
fix: update createReducer to fix initial state
Browse files Browse the repository at this point in the history
  • Loading branch information
DmacMcgreg authored Aug 20, 2019
1 parent 3782dc7 commit fd083f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/createReducer.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Demo = ({ initialCount = 1 }) => {
<p>count: {state.count}</p>
<button onClick={() => dispatch(addAndReset())}>Add and reset</button>
<button
onClick={() => dispatch({ type: 'reset', payload: initialCount })}
onClick={() => dispatch({ type: 'reset', payload: { count: initialCount }})}
>
Reset
</button>
Expand Down

0 comments on commit fd083f2

Please sign in to comment.