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

Function abortTaskDEV

packages/react-server/src/ReactFizzServer.js:4877–4896  ·  view source on GitHub ↗
(task: Task, request: Request, error: mixed)

Source from the content-addressed store, hash-verified

4875}
4876
4877function abortTaskDEV(task: Task, request: Request, error: mixed): void {
4878 if (__DEV__) {
4879 const prevTaskInDEV = currentTaskInDEV;
4880 const prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack;
4881 setCurrentTaskInDEV(task);
4882 ReactSharedInternals.getCurrentStack = getCurrentStackInDEV;
4883 try {
4884 abortTask(task, request, error);
4885 } finally {
4886 setCurrentTaskInDEV(prevTaskInDEV);
4887 ReactSharedInternals.getCurrentStack = prevGetCurrentStackImpl;
4888 }
4889 } else {
4890 // These errors should never make it into a build so we don't need to encode them in codes.json
4891 // eslint-disable-next-line react-internal/prod-error-codes
4892 throw new Error(
4893 'abortTaskDEV should never be called in production mode. This is a bug in React.',
4894 );
4895 }
4896}
4897
4898function safelyEmitEarlyPreloads(
4899 request: Request,

Callers 1

abortFunction · 0.85

Calls 2

setCurrentTaskInDEVFunction · 0.90
abortTaskFunction · 0.70

Tested by

no test coverage detected