Skip to content

Commit

Permalink
fix(examples/with-redux-wrapper): wrong initial state (close vercel#1…
Browse files Browse the repository at this point in the history
…7299) (vercel#17335)

Wrong variable was being checked for the hydrate action on redux. This was causing the count to be reset to 0 instead of being 1 when initially loading index.js page.

Fixes vercel#17299
  • Loading branch information
Pitasi authored and Piotr Bosak committed Sep 26, 2020
1 parent e490616 commit 4192125
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/with-redux-wrapper/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const reducer = (state, action) => {
...state, // use previous state
...action.payload, // apply delta from hydration
}
if (state.count) nextState.count = state.count // preserve count value on client side navigation
if (state.count.count) nextState.count.count = state.count.count // preserve count value on client side navigation
return nextState
} else {
return combinedReducer(state, action)
Expand Down

0 comments on commit 4192125

Please sign in to comment.