Skip to content

Commit

Permalink
fix(examples/with-redux-wrapper): wrong initial state (close #17299) (#…
Browse files Browse the repository at this point in the history
…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 #17299
  • Loading branch information
Pitasi authored Sep 24, 2020
1 parent c45497e commit c388048
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 c388048

Please sign in to comment.