MCPcopy
hub / github.com/vercel/next.js / startTransition

Function startTransition

packages/next/src/compiled/react/cjs/react.production.js:321–344  ·  view source on GitHub ↗
(scope)

Source from the content-addressed store, hash-verified

319 console.error(error);
320 };
321function startTransition(scope) {
322 var prevTransition = ReactSharedInternals.T,
323 currentTransition = {};
324 currentTransition.types =
325 null !== prevTransition ? prevTransition.types : null;
326 ReactSharedInternals.T = currentTransition;
327 try {
328 var returnValue = scope(),
329 onStartTransitionFinish = ReactSharedInternals.S;
330 null !== onStartTransitionFinish &&
331 onStartTransitionFinish(currentTransition, returnValue);
332 "object" === typeof returnValue &&
333 null !== returnValue &&
334 "function" === typeof returnValue.then &&
335 returnValue.then(noop, reportGlobalError);
336 } catch (error) {
337 reportGlobalError(error);
338 } finally {
339 null !== prevTransition &&
340 null !== currentTransition.types &&
341 (prevTransition.types = currentTransition.types),
342 (ReactSharedInternals.T = prevTransition);
343 }
344}
345function addTransitionType(type) {
346 var transition = ReactSharedInternals.T;
347 if (null !== transition) {

Callers 15

callServerFunction · 0.90
dispatchActionFunction · 0.90
CatchErrorClass · 0.90
onPopStateFunction · 0.90
processMessageFunction · 0.90
renderAppDevOverlayFunction · 0.90
renderPagesDevOverlayFunction · 0.90
ErrorOverlayPaginationFunction · 0.90

Calls 3

scopeFunction · 0.85
thenMethod · 0.80
reportGlobalErrorFunction · 0.50

Tested by

no test coverage detected