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

Function getSuspendedThenable

packages/react-server/src/ReactFizzThenable.js:151–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149// reasons, expects to receive a thenable.
150let suspendedThenable: Thenable<any> | null = null;
151export function getSuspendedThenable(): Thenable<mixed> {
152 // This is called right after `use` suspends by throwing an exception. `use`
153 // throws an opaque value instead of the thenable itself so that it can't be
154 // caught in userspace. Then the work loop accesses the actual thenable using
155 // this function.
156 if (suspendedThenable === null) {
157 throw new Error(
158 'Expected a suspended thenable. This is a bug in React. Please file ' +
159 'an issue.',
160 );
161 }
162 const thenable = suspendedThenable;
163 suspendedThenable = null;
164 return thenable;
165}

Callers 3

renderNodeFunction · 0.90
retryRenderTaskFunction · 0.90
retryReplayTaskFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected