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

Function scheduleRootUpdate

code/new-context-api/public/app.js:13425–13451  ·  view source on GitHub ↗
(current, element, currentTime, expirationTime, callback)

Source from the content-addressed store, hash-verified

13423 }
13424
13425 function scheduleRootUpdate(current, element, currentTime, expirationTime, callback) {
13426 {
13427 if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) {
13428 didWarnAboutNestedUpdates = true;
13429 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');
13430 }
13431 }
13432
13433 callback = callback === undefined ? null : callback;
13434 {
13435 warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
13436 }
13437
13438 var update = {
13439 expirationTime: expirationTime,
13440 partialState: { element: element },
13441 callback: callback,
13442 isReplace: false,
13443 isForced: false,
13444 capturedValue: null,
13445 next: null
13446 };
13447 insertUpdateIntoFiber(current, update);
13448 scheduleWork(current, expirationTime);
13449
13450 return expirationTime;
13451 }
13452
13453 function updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback) {
13454 // 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