ui icon indicating copy to clipboard operation
ui copied to clipboard

Issue with NavigationMenu when using asChild

Open jessekelly881 opened this issue 2 years ago • 2 comments

The implementation of NavigationMenu currently looks like this:

{children}
<NavigationMenuViewport />

This breaks when using asChild because that prop can only be used with one child. However, wrapping it with <></> solves the problem.

<>
{children}
<NavigationMenuViewport />
</>

jessekelly881 avatar Nov 09 '23 16:11 jessekelly881

https://github.com/shadcn-ui/ui/pull/1592

I belive this fixes it. Would be nice if anyone on the team @shadcn could give me some feedback on it as its been a while this thing keeps coming up

Joshuajrodrigues avatar Jan 13 '24 14:01 Joshuajrodrigues

Thanks @Joshuajrodrigues! Very much appreciated. 🙏

jessekelly881 avatar Jan 14 '24 10:01 jessekelly881

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Feb 12 '24 23:02 shadcn