mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
[Flight] Treat empty message as a close signal (#33756)
We typically treat an empty message as closing the debug channel stream but for the Noop renderer we don't use an intermediate stream but just pass the message through. https://github.com/facebook/react/blob/bbc13fa17be8eebef3e6ee47f48c76c0c44e2f36/packages/react-server-dom-webpack/src/client/ReactFlightDOMClientBrowser.js#L59-L60 For that simple case we should just treat it as a close without an intermediate stream.
This commit is contained in:
1 parent
463b808176
commit
eed2560762
1 file changed
+4
@@ -5808,6 +5808,10 @@ export function resolveDebugMessage(request: Request, message: string): void {
|
||||
"resolveDebugMessage/closeDebugChannel should not be called for a Request that wasn't kept alive. This is a bug in React.",
|
||||
);
|
||||
}
|
||||
if (message === '') {
|
||||
closeDebugChannel(request);
|
||||
return;
|
||||
}
|
||||
// This function lets the client ask for more data lazily through the debug channel.
|
||||
const command = message.charCodeAt(0);
|
||||
const ids = message.slice(2).split(',').map(fromHex);
|
||||
|
||||
Reference in new issue
Block a user