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

Function getSuspendedThenable

packages/react-server/src/ReactFlightThenable.js:145–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 2

renderModelFunction · 0.90
retryTaskFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected