Skip to content

"DropdownMenuTrigger must be used within DropdownMenu" with Astro #1509

Closed Answered by benjamin-guibert
benjamin-guibert asked this question in Q&A
Discussion options

You must be logged in to vote

I've found the issue: Astro treats all React components as server components by default.

I fixed the issue by calling my component in a .tsx file instead of .astro file and added the prop client:load in the parent .astro file.

It would be great if there were a warning on this page that interactive components should be specified as client components with client:load prop. 🙏🏻

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by benjamin-guibert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant