-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Description
We use Suspense component in NextJs project to catch server side errors in components and to prevent ruining the whole page as recommended here.
In React 19.1 Suspense just renders children on page rendered on server side without JS. So if user without JS opens page, he gets regular page with the content.
In React 19.2 Suspense renders fallback and never renders children on page rendered on server side without JS. So now if user without JS opens page, he gets blank page.
It seems like Suspense does not render children if they are too big while it works fine for smaller children.
We are relying on Suspense behaviour from React 19.1 to keep page content accessible to non-JS users so we would like to know if new Suspense behaviour is standard now? If yes, if there any recommended way to capture server side rendering errors like Suspense does?
React version: 19.2.3
Steps To Reproduce
- Run this project locally https://github.com/yoksel/suspense-issue and open it in browser
- Switch off JS and reload the page to see the result of server side rendering
- Check the first demo and see that
Suspenseshows fallback instead of children if the children are too big. - Check the second demo and see that
Suspenseshows children if the children are small.
Link to code example:
https://github.com/yoksel/suspense-issue
The current behavior
When children are too big, Suspense renders fallback instead on page without JS even if there is no server errors in component
The expected behavior
Suspense renders children if there is no server errors in component on page without JS