primitives icon indicating copy to clipboard operation
primitives copied to clipboard

`asChild` doesn't work reliably with Server Components

Open amannn opened this issue 4 months ago • 1 comments

Bug report

Current Behavior

The asChild API doesn't work reliably with Server Components. It somehow works to some extent, but when children are declared with async or have a call to use(promise) internally, then the rendering fails.

Expected behavior

asChild should work reliably everywhere.

Reproducible example

Suggested solution

https://x.com/souporserious/status/1753859984344121754

Your environment

Please see the StackBlitz examples.

Software Name(s) Version
Radix Package(s) @radix-ui/react-dropdown-menu 2.1.1
React n/a 18.3.0
Browser Chrome Version 129.0.6668.60
Assistive tech - -
Node n/a 18.20.3
npm/yarn npm 10.2.3
Operating System macOS 14.6.1

amannn avatar Oct 02 '24 09:10 amannn