dillon1000/react
Commit
Browse files [Flight] Allow Temporary References to be awaited (#34084)
Fixes #33534. `.then` method can be tested when you await a value that's not a Promise. For regular Client References we have a way to mark those as "async" and yield a reference to the unwrapped value in case it's a Promise on the Client. However, the realization is that we never serialize Promises as opaque when passed from the client to the server. If a Promise is passed, then it would've been deserialized as a Promise (while still registered as a temporary reference) and not one of these Proxy objects. Technically it could be a non-function value on the client which would be wrong but you're not supposed to dot into it in the first place. So we can just assume it's `undefined`.
Changed paths3 files
First-parent comparisonpackages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js ModifiedM packages/react-server/src/ReactFlightServerTemporaryReferences.js ModifiedD packages/react-server/src/__tests__/ReactFlightServerTemporaryReferences-test.js DeletedPatch
Files changed
Rendering syntax-highlighted changes…