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

[Overlay] add backdrop key #2262

Merged
merged 1 commit into from
Mar 20, 2018
Merged

[Overlay] add backdrop key #2262

merged 1 commit into from
Mar 20, 2018

Conversation

giladgray
Copy link
Contributor

fixes #2246

@reiv
Copy link
Contributor

reiv commented Mar 17, 2018

Missing a key here, too.

<CSSTransition classNames={transitionName} timeout={transitionDuration}>
{decoratedChild}
</CSSTransition>

@giladgray
Copy link
Contributor Author

@reiv i thought so too, but the warning disappeared the moment i added just the one key in this PR.
i think React.Children.map is smart about keys and adds them itself?

@reiv
Copy link
Contributor

reiv commented Mar 19, 2018

@giladgray Looks like you're right -- if the Children.map callback returns a React element, it generates (or replaces) its key; the children that are mapped over already have keys of their own so it uses those (source). The docs don't mention it, however.

@blueprint-bot
Copy link

add backdrop key

Preview: documentation | landing | table

@giladgray giladgray requested a review from themadcreator March 19, 2018 20:57
@giladgray giladgray merged commit 0f5b38f into develop Mar 20, 2018
@giladgray giladgray deleted the gg/overlay-backdrop-key branch March 20, 2018 21:44
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.

Overlay causes Warning: Each child in an array or iterator should have a unique "key" prop.
4 participants