MCPcopy
hub / github.com/react/create-react-app / enqueueUpdate

Function enqueueUpdate

packages/react-error-overlay/fixtures/bundle_u.mjs:2274–2292  ·  view source on GitHub ↗

* Mark a component as needing a rerender, adding an optional callback to a * list of functions which will be executed once the rerender occurs.

(component)

Source from the content-addressed store, hash-verified

2272 * list of functions which will be executed once the rerender occurs.
2273 */
2274function enqueueUpdate(component) {
2275 ensureInjected();
2276
2277 // Various parts of our code (such as ReactCompositeComponent's
2278 // _renderValidatedComponent) assume that calls to render aren't nested;
2279 // verify that that's the case. (This is called by each top-level update
2280 // function, like setState, forceUpdate, etc.; creation and
2281 // destruction of top-level components is guarded in ReactMount.)
2282
2283 if (!batchingStrategy.isBatchingUpdates) {
2284 batchingStrategy.batchedUpdates(enqueueUpdate, component);
2285 return;
2286 }
2287
2288 dirtyComponents.push(component);
2289 if (component._updateBatchNumber == null) {
2290 component._updateBatchNumber = updateBatchNumber + 1;
2291 }
2292}
2293
2294/**
2295 * Enqueue a callback to be run at the end of the current batching cycle. Throws

Callers 1

bundle_u.mjsFile · 0.70

Calls 1

ensureInjectedFunction · 0.70

Tested by

no test coverage detected