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

Context created by the App component has items with duplicate keys #39789

Closed
tebafu opened this issue Dec 24, 2022 · 3 comments
Closed

Context created by the App component has items with duplicate keys #39789

tebafu opened this issue Dec 24, 2022 · 3 comments

Comments

@tebafu
Copy link

tebafu commented Dec 24, 2022

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Use the App component from antd anywhere in a react app.

What is expected?

No warnings for duplicate keys in the console.

What is actually happening?

The following warning is displayed in the console:

Warning: Encountered two children with the same key, holder. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.

React dev tools show the following items in the context created by the App component:

  1. Anonymous Memo
  2. Anonymous key="holder" ForwardRef
  3. Anonymous key="holder" ForwardRef
Environment Info
antd 5.1.0
React 18.2.0
System Microsoft Windows 10 Education Version 10.0.19044 Build 19044
Browser Chrome Version 108.0.5359.125 (Official Build) (64-bit)
@github-actions
Copy link
Contributor

@li-jia-nan
Copy link
Member

@zombieJ
Copy link
Member

zombieJ commented Dec 25, 2022

Duplicate of #39694

@zombieJ zombieJ marked this as a duplicate of #39694 Dec 25, 2022
@zombieJ zombieJ closed this as completed Dec 25, 2022
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

No branches or pull requests

3 participants