MCPcopy Create free account
hub / github.com/caseywebdev/react-list / dispatchSetStateInternal

Function dispatchSetStateInternal

docs/index.js:8157–8197  ·  view source on GitHub ↗
(fiber, queue, action, lane)

Source from the content-addressed store, hash-verified

8155 dispatchSetStateInternal(fiber, queue, action, lane);
8156}
8157function dispatchSetStateInternal(fiber, queue, action, lane) {
8158 var update = {
8159 lane: lane,
8160 revertLane: 0,
8161 action: action,
8162 hasEagerState: !1,
8163 eagerState: null,
8164 next: null
8165 };
8166 if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
8167 else {
8168 var alternate = fiber.alternate;
8169 if (
8170 0 === fiber.lanes &&
8171 (null === alternate || 0 === alternate.lanes) &&
8172 ((alternate = queue.lastRenderedReducer), null !== alternate)
8173 )
8174 try {
8175 var currentState = queue.lastRenderedState,
8176 eagerState = alternate(currentState, action);
8177 update.hasEagerState = !0;
8178 update.eagerState = eagerState;
8179 if (objectIs(eagerState, currentState))
8180 return (
8181 enqueueUpdate$1(fiber, queue, update, 0),
8182 null === workInProgressRoot && finishQueueingConcurrentUpdates(),
8183 !1
8184 );
8185 } catch (error) {
8186 } finally {
8187 }
8188 action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
8189 if (null !== action)
8190 return (
8191 scheduleUpdateOnFiber(action, fiber, lane),
8192 entangleTransitionUpdate(action, queue, lane),
8193 !0
8194 );
8195 }
8196 return !1;
8197}
8198function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
8199 action = {
8200 lane: 2,

Callers 3

startTransitionFunction · 0.85
requestFormReset$1Function · 0.85
dispatchSetStateFunction · 0.85

Calls 7

isRenderPhaseUpdateFunction · 0.85
enqueueRenderPhaseUpdateFunction · 0.85
enqueueUpdate$1Function · 0.85
scheduleUpdateOnFiberFunction · 0.85
entangleTransitionUpdateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…