Skip to content

Commit 765ae43

Browse files
committed
Naive fix
1 parent c3289ee commit 765ae43

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/react-reconciler/src/ReactFiberHooks.new.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,9 @@ function updateReducer<S, I, A>(
821821
newState = ((update.eagerState: any): S);
822822
} else {
823823
const action = update.action;
824-
newState = reducer(newState, action);
824+
const reducerImpl =
825+
update.eagerReducer !== null ? update.eagerReducer : reducer;
826+
newState = reducerImpl(newState, action);
825827
}
826828
}
827829
update = update.next;

packages/react-reconciler/src/ReactFiberHooks.old.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,9 @@ function updateReducer<S, I, A>(
821821
newState = ((update.eagerState: any): S);
822822
} else {
823823
const action = update.action;
824-
newState = reducer(newState, action);
824+
const reducerImpl =
825+
update.eagerReducer !== null ? update.eagerReducer : reducer;
826+
newState = reducerImpl(newState, action);
825827
}
826828
}
827829
update = update.next;

0 commit comments

Comments
 (0)