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

Function scheduleRootUpdate

code/third-party/public/app.js:13297–13323  ·  view source on GitHub ↗
(current, element, currentTime, expirationTime, callback)

Source from the content-addressed store, hash-verified

13295 }
13296
13297 function scheduleRootUpdate(current, element, currentTime, expirationTime, callback) {
13298 {
13299 if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) {
13300 didWarnAboutNestedUpdates = true;
13301 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');
13302 }
13303 }
13304
13305 callback = callback === undefined ? null : callback;
13306 {
13307 warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
13308 }
13309
13310 var update = {
13311 expirationTime: expirationTime,
13312 partialState: { element: element },
13313 callback: callback,
13314 isReplace: false,
13315 isForced: false,
13316 capturedValue: null,
13317 next: null
13318 };
13319 insertUpdateIntoFiber(current, update);
13320 scheduleWork(current, expirationTime);
13321
13322 return expirationTime;
13323 }
13324
13325 function updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback) {
13326 // 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