-
Notifications
You must be signed in to change notification settings - Fork 50k
Description
Suspense fallback is not rendered during SSR when the root component lacks top-level <html>, <head>, or <body> tags. The server buffers the entire response until all suspended promises resolve, preventing streaming and the rendering of the initial fallback content.
This behavior impacts a use case where the React component is rendered as a sub-tree to be integrated into a larger application that uses a different framework.
This commit introduced this behavior change in the streaming logic where it worked in 19.0.0.
React version: 19.1-19.2
Steps To Reproduce
The current behavior
The server renders the component's final output without showing the fallback. The generated HTML for the suspended component only contains the resolved content wrapped in the standard suspense boundary markers:
<!--$--><h1>Hello</h1><!--/$-->No fallback content (i.e., the "Loading..." message) is rendered to the client.
The expected behavior
TheLoading... fallback should be rendered, mirroring the correct behavior observed in the full-document rendering path:
<!--$-->
<!--$?-->
<template id="B:0"></template>
Loading...
<!--/$-->
<!--/$-->
<script id="_R_">
...
</script>
<div hidden id="S:0">
<h1>Hello</h1>
</div>
<script>
...
</script>Comparison Path: https://3c4mqn-8080.csb.app/