Skip to content

Commit

Permalink
Naive fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jun 30, 2021
1 parent 1f7d10e commit 2a092ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/react-reconciler/src/ReactFiberHooks.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,9 @@ function updateReducer<S, I, A>(
newState = ((update.eagerState: any): S);
} else {
const action = update.action;
newState = reducer(newState, action);
const reducerImpl =
update.eagerReducer !== null ? update.eagerReducer : reducer;
newState = reducerImpl(newState, action);
}
}
update = update.next;
Expand Down
4 changes: 3 additions & 1 deletion packages/react-reconciler/src/ReactFiberHooks.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,9 @@ function updateReducer<S, I, A>(
newState = ((update.eagerState: any): S);
} else {
const action = update.action;
newState = reducer(newState, action);
const reducerImpl =
update.eagerReducer !== null ? update.eagerReducer : reducer;
newState = reducerImpl(newState, action);
}
}
update = update.next;
Expand Down

0 comments on commit 2a092ae

Please sign in to comment.