MCPcopy Create free account
hub / github.com/reactjs/react-rails / enqueueUpdate

Function enqueueUpdate

lib/assets/react-source/development/react.js:15887–15915  ·  view source on GitHub ↗
(fiber, update)

Source from the content-addressed store, hash-verified

15885 return update;
15886 }
15887 function enqueueUpdate(fiber, update) {
15888 var updateQueue = fiber.updateQueue;
15889
15890 if (updateQueue === null) {
15891 // Only occurs if the fiber has been unmounted.
15892 return;
15893 }
15894
15895 var sharedQueue = updateQueue.shared;
15896 var pending = sharedQueue.pending;
15897
15898 if (pending === null) {
15899 // This is the first update. Create a circular list.
15900 update.next = update;
15901 } else {
15902 update.next = pending.next;
15903 pending.next = update;
15904 }
15905
15906 sharedQueue.pending = update;
15907
15908 {
15909 if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
15910 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.');
15911
15912 didWarnUpdateInsideUpdate = true;
15913 }
15914 }
15915 }
15916 function enqueueCapturedUpdate(workInProgress, update) {
15917 var current = workInProgress.alternate;
15918

Callers 6

propagateContextChangeFunction · 0.85
react.jsFile · 0.85
throwExceptionFunction · 0.85
captureCommitPhaseErrorFunction · 0.85
updateContainerFunction · 0.85

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected