-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Popover not setting 'key' prop internally #3305
Comments
Hey — you need to set a key on your {menuLinks.map((link) => (
<>
<a key={link.href + link.linkText} href={link.href}>
{link.linkText}
</a>
</>
))} You want this: {menuLinks.map((link) => (
<Fragment key={link.href + link.linkText}>
<a href={link.href}>
{link.linkText}
</a>
</Fragment>
))} Hope that helps! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v2.0.4
What browser are you using?
Chrome 126.0.6478.62
Reproduction URL
https://codesandbox.io/p/sandbox/headless-ui-react-popover-missing-keys-74z5yc
Describe your issue
It seems that HeadlessUI's Popover does not set keys somewhere internally. React throws a warning in the browser console; you may confirm this in the Sandbox itself.
The text was updated successfully, but these errors were encountered: