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

Function scheduleRootUpdate

code/dependency-injection/public/app.js:14157–14183  ·  view source on GitHub ↗
(current, element, currentTime, expirationTime, callback)

Source from the content-addressed store, hash-verified

14155 }
14156
14157 function scheduleRootUpdate(current, element, currentTime, expirationTime, callback) {
14158 {
14159 if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) {
14160 didWarnAboutNestedUpdates = true;
14161 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');
14162 }
14163 }
14164
14165 callback = callback === undefined ? null : callback;
14166 {
14167 warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
14168 }
14169
14170 var update = {
14171 expirationTime: expirationTime,
14172 partialState: { element: element },
14173 callback: callback,
14174 isReplace: false,
14175 isForced: false,
14176 capturedValue: null,
14177 next: null
14178 };
14179 insertUpdateIntoFiber(current, update);
14180 scheduleWork(current, expirationTime);
14181
14182 return expirationTime;
14183 }
14184
14185 function updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback) {
14186 // 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