Bug: renderToStaticMarkup
throws error on client components
#32715
Labels
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
React version: 19.0.0
Steps To Reproduce
'use client'
directive.renderToStaticMarkup
with the server component.Link to code example: https://codesandbox.io/p/devbox/keen-williamson-wg9p8w (using Next.js to demonstrate
'use client'
)The current behavior
renderToStaticMarkup
throws anError
when it encounters a client component:The expected behavior
When
renderToStaticMarkup
encounters a client component, it renders non-interactive HTML for the component, just as pre-rendering would during SSR.The text was updated successfully, but these errors were encountered: