Post

A new React 19 feature that might have gone unnoticed: ReactDOMStatic.prerender(<App />) It's like the old renderToString API, but unlike renderToString, prerender will wait for Suspense boundaries to finish before returning the HTML.

Even for SSG, if you’re uploading to a CDN it’s more efficient to use their streaming APIs and skip decoding and encoding again, but in the future prerender could be used to stream the shell in a response and resume the shell for dynamic content.

You can always read the stream to get a string, but you can’t convert a string back to a stream cost free.

0 reposts0 likes

No replies yet.