Skip to content

[Slot] Prevent key warning #1015

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

Merged
merged 1 commit into from
Dec 3, 2021
Merged

[Slot] Prevent key warning #1015

merged 1 commit into from
Dec 3, 2021

Conversation

jjenzz
Copy link
Contributor

@jjenzz jjenzz commented Dec 3, 2021

Closes #1013

Admittedly, I don't seem to be able to reproduce the issue but makes sense so I've switched it to use React.Children.map to prevent any warnings like that regardless.

Copy link
Contributor

@benoitgrelard benoitgrelard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Admittedly, I don't seem to be able to reproduce the issue but makes sense so I've switched it to use React.Children.map to prevent any warnings like that regardless.

It can be reproduced in cases where we have used Slottable, ie. when there are multiple children internally.
We actually have an example of it in the chromatic story of Tooltip and you can see the error in the console.

I can confirm this fix resolves the issue.

@jjenzz jjenzz merged commit a975b3e into main Dec 3, 2021
@jjenzz jjenzz deleted the key-warning branch December 3, 2021 13:43
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

Successfully merging this pull request may close these issues.

[Slot] Triggers a warning in dev mode about keys
2 participants