Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asChild doesn't work with async components #3165

Open
amannn opened this issue Oct 2, 2024 · 1 comment
Open

asChild doesn't work with async components #3165

amannn opened this issue Oct 2, 2024 · 1 comment

Comments

@amannn
Copy link

amannn commented Oct 2, 2024

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
@yordis
Copy link

yordis commented Oct 9, 2024

@vladmoroz any updates over here? I just ran into the issue

@vladmoroz vladmoroz changed the title asChild doesn't work reliably with Server Components asChild doesn't work with asyc components Oct 29, 2024
@vladmoroz vladmoroz changed the title asChild doesn't work with asyc components asChild doesn't work with async components Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants