MCPcopy
hub / github.com/facebook/react / reducer

Function reducer

packages/react-reconciler/src/ReactFiberHooks.js:1519–1525  ·  view source on GitHub ↗
(update.hasEagerState)

Source from the content-addressed store, hash-verified

1517 const action = update.action;
1518 if (shouldDoubleInvokeUserFnsInHooksDEV) {
1519 reducer(newState, action);
1520 }
1521 if (update.hasEagerState) {
1522 // If this update is a state update (not a reducer) and was processed eagerly,
1523 // we can use the eagerly computed state
1524 newState = ((update.eagerState: any): S);
1525 } else {
1526 newState = reducer(newState, action);
1527 }
1528 }

Callers 2

ReactFiberHooks.jsFile · 0.70
useReducerFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected