Skip to content

Commit dd404d0

Browse files
committed
Naive fix
1 parent 5b0d86b commit dd404d0

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
@@ -822,7 +822,9 @@ function updateReducer<S, I, A>(
822822
newState = ((update.eagerState: any): S);
823823
} else {
824824
const action = update.action;
825-
newState = reducer(newState, action);
825+
const reducerImpl =
826+
update.eagerReducer !== null ? update.eagerReducer : reducer;
827+
newState = reducerImpl(newState, action);
826828
}
827829
}
828830
update = update.next;

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

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

0 commit comments

Comments
 (0)