MCPcopy Create free account
hub / github.com/plotly/dash / enqueueUpdate

Function enqueueUpdate

dash/deps/react-dom@18.3.1.js:14610–14650  ·  view source on GitHub ↗
(fiber, update, lane)

Source from the content-addressed store, hash-verified

14608 return update;
14609 }
14610 function enqueueUpdate(fiber, update, lane) {
14611 var updateQueue = fiber.updateQueue;
14612
14613 if (updateQueue === null) {
14614 // Only occurs if the fiber has been unmounted.
14615 return null;
14616 }
14617
14618 var sharedQueue = updateQueue.shared;
14619
14620 {
14621 if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
14622 error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
14623
14624 didWarnUpdateInsideUpdate = true;
14625 }
14626 }
14627
14628 if (isUnsafeClassRenderPhaseUpdate()) {
14629 // This is an unsafe render phase update. Add directly to the update
14630 // queue so we can process it immediately during the current render.
14631 var pending = sharedQueue.pending;
14632
14633 if (pending === null) {
14634 // This is the first update. Create a circular list.
14635 update.next = update;
14636 } else {
14637 update.next = pending.next;
14638 pending.next = update;
14639 }
14640
14641 sharedQueue.pending = update; // Update the childLanes even though we're most likely already rendering
14642 // this fiber. This is for backwards compatibility in the case where you
14643 // update a different component during render phase than the one that is
14644 // currently renderings (a pattern that is accompanied by a warning).
14645
14646 return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);
14647 } else {
14648 return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane);
14649 }
14650 }
14651 function entangleTransitions(root, fiber, lane) {
14652 var updateQueue = fiber.updateQueue;
14653

Callers 6

captureCommitPhaseErrorFunction · 0.70
createHydrationContainerFunction · 0.70
updateContainerFunction · 0.70

Calls 3

errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…