Skip to content

Commit e501ddc

Browse files
author
Zack Story
authored
(persistReducer): only reconciler defined state (#698)
1 parent dfcd907 commit e501ddc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/persistReducer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ export default function persistReducer<State: Object, Action: Object>(
132132
if (action.key === config.key) {
133133
let reducedState = baseReducer(restState, action)
134134
let inboundState = action.payload
135+
// only reconcile state if stateReconciler and inboundState are both defined
135136
let reconciledRest: State =
136-
stateReconciler !== false
137+
stateReconciler !== false && inboundState !== undefined
137138
? stateReconciler(inboundState, state, reducedState, config)
138139
: reducedState
139140

0 commit comments

Comments
 (0)