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

Function scheduleRootUpdate

code/higher-order-components/public/app.js:14058–14084  ·  view source on GitHub ↗
(current, element, currentTime, expirationTime, callback)

Source from the content-addressed store, hash-verified

14056 }
14057
14058 function scheduleRootUpdate(current, element, currentTime, expirationTime, callback) {
14059 {
14060 if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) {
14061 didWarnAboutNestedUpdates = true;
14062 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');
14063 }
14064 }
14065
14066 callback = callback === undefined ? null : callback;
14067 {
14068 warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
14069 }
14070
14071 var update = {
14072 expirationTime: expirationTime,
14073 partialState: { element: element },
14074 callback: callback,
14075 isReplace: false,
14076 isForced: false,
14077 capturedValue: null,
14078 next: null
14079 };
14080 insertUpdateIntoFiber(current, update);
14081 scheduleWork(current, expirationTime);
14082
14083 return expirationTime;
14084 }
14085
14086 function updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback) {
14087 // 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