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

Function scheduleRootUpdate

code/one-direction-data-flow/public/app.js:13937–13963  ·  view source on GitHub ↗
(current, element, currentTime, expirationTime, callback)

Source from the content-addressed store, hash-verified

13935 }
13936
13937 function scheduleRootUpdate(current, element, currentTime, expirationTime, callback) {
13938 {
13939 if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) {
13940 didWarnAboutNestedUpdates = true;
13941 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');
13942 }
13943 }
13944
13945 callback = callback === undefined ? null : callback;
13946 {
13947 warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
13948 }
13949
13950 var update = {
13951 expirationTime: expirationTime,
13952 partialState: { element: element },
13953 callback: callback,
13954 isReplace: false,
13955 isForced: false,
13956 capturedValue: null,
13957 next: null
13958 };
13959 insertUpdateIntoFiber(current, update);
13960 scheduleWork(current, expirationTime);
13961
13962 return expirationTime;
13963 }
13964
13965 function updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback) {
13966 // 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