[React 19] Bug: cloneElement
in client component with async server component as children not working
#32392
Labels
cloneElement
in client component with async server component as children not working
#32392
React version: 19
Steps To Reproduce
npm i
npm run dev
Link to code example: https://github.com/darthmaim-reproductions/vercel-next.js-72034
The current behavior
When using
cloneElement
in a client component, and the children is an async server component, this error is thrown:When the server component is not
async
(or a client component), this just works.Additionally, adding this line to the client component also makes this work:
The expected behavior
Since
cloneElement
works for client components and non-async server components, I expected this to work with async server components as well.Additional context
With react 18 the children was reported as
<Lazy/>
in react-dev-tools andcloneElement
was working, now it is shown as{ $$typeof: Symbol(react.lazy) }
(when not using cloneElement to avoid the error).I initially reported this is in the Next.js repo (vercel/next.js#72034), but I keep running into this bug and suspect its a react bug and not related to Next.js.
The text was updated successfully, but these errors were encountered: