MCPcopy
hub / github.com/facebook/react / deferredUpdates

Function deferredUpdates

packages/react-reconciler/src/ReactFiberWorkLoop.js:1750–1761  ·  view source on GitHub ↗
(fn: () => A)

Source from the content-addressed store, hash-verified

1748}
1749
1750export function deferredUpdates<A>(fn: () => A): A {
1751 const prevTransition = ReactSharedInternals.T;
1752 const previousPriority = getCurrentUpdatePriority();
1753 try {
1754 setCurrentUpdatePriority(DefaultEventPriority);
1755 ReactSharedInternals.T = null;
1756 return fn();
1757 } finally {
1758 setCurrentUpdatePriority(previousPriority);
1759 ReactSharedInternals.T = prevTransition;
1760 }
1761}
1762
1763export function batchedUpdates<A, R>(fn: A => R, a: A): R {
1764 if (disableLegacyMode) {

Callers

nothing calls this directly

Calls 3

getCurrentUpdatePriorityFunction · 0.90
setCurrentUpdatePriorityFunction · 0.90
fnFunction · 0.50

Tested by

no test coverage detected