MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / scheduleRootUpdate

Function scheduleRootUpdate

code/controlled-uncontrolled/public/app.js:13388–13414  ·  view source on GitHub ↗
(current, element, currentTime, expirationTime, callback)

Source from the content-addressed store, hash-verified

13386 }
13387
13388 function scheduleRootUpdate(current, element, currentTime, expirationTime, callback) {
13389 {
13390 if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) {
13391 didWarnAboutNestedUpdates = true;
13392 warning(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(ReactDebugCurrentFiber.current) || 'Unknown');
13393 }
13394 }
13395
13396 callback = callback === undefined ? null : callback;
13397 {
13398 warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
13399 }
13400
13401 var update = {
13402 expirationTime: expirationTime,
13403 partialState: { element: element },
13404 callback: callback,
13405 isReplace: false,
13406 isForced: false,
13407 capturedValue: null,
13408 next: null
13409 };
13410 insertUpdateIntoFiber(current, update);
13411 scheduleWork(current, expirationTime);
13412
13413 return expirationTime;
13414 }
13415
13416 function updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback) {
13417 // TODO: If this is a nested container, this won't be the root.

Callers 1

Calls 4

warningFunction · 0.85
getComponentNameFunction · 0.70
insertUpdateIntoFiberFunction · 0.70
scheduleWorkFunction · 0.70

Tested by

no test coverage detected