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

Encountered two children with the same key #43795

Closed
Nefcanto opened this issue Sep 17, 2024 · 3 comments
Closed

Encountered two children with the same key #43795

Nefcanto opened this issue Sep 17, 2024 · 3 comments
Assignees
Labels
component: autocomplete This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@Nefcanto
Copy link

Nefcanto commented Sep 17, 2024

Steps to reproduce

Create an MUI app and use autocomplete. You should see:

Warning: Encountered two children with the same key, ``. 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.
ul
withEmotionCache2/<@https://client.menutime.local/node_modules/.vite/deps/chunk-EAUZXVZV.js?v=783f97bd:692:45
div
withEmotionCache2/<@https://client.menutime.local/node_modules/.vite/deps/chunk-EAUZXVZV.js?v=783f97bd:692:45
Paper2@https://client.menutime.local/node_modules/.vite/deps/chunk-SNTBBM6X.js?v=783f97bd:101:32
withEmotionCache2/<@https://client.menutime.local/node_modules/.vite/deps/chunk-EAUZXVZV.js?v=783f97bd:692:45
div
PopperTooltip2@https://client.menutime.local/node_modules/.vite/deps/chunk-7LK47B33.js?v=783f97bd:1572:7
Portal2@https://client.menutime.local/node_modules/.vite/deps/chunk-NGWQQGGN.js?v=783f97bd:38:7
Popper2@https://client.menutime.local/node_modules/.vite/deps/chunk-7LK47B33.js?v=783f97bd:1689:7
withEmotionCache2/<@https://client.menutime.local/node_modules/.vite/deps/chunk-EAUZXVZV.js?v=783f97bd:692:45
Popper4@https://client.menutime.local/node_modules/.vite/deps/chunk-7LK47B33.js?v=783f97bd:1874:17
withEmotionCache2/<@https://client.menutime.local/node_modules/.vite/deps/chunk-EAUZXVZV.js?v=783f97bd:692:45
Autocomplete2@https://client.menutime.local/node_modules/.vite/deps/@mui_material_Autocomplete.js?v=d4467d5a:1549:32
div
withEmotionCache2/<@https://client.menutime.local/node_modules/.vite/deps/chunk-EAUZXVZV.js?v=783f97bd:692:45
FormControl2@https://client.menutime.local/node_modules/.vite/deps/chunk-IWZZKCP6.js?v=783f97bd:114:32

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

No response

Search keywords: same key

@Nefcanto Nefcanto added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 17, 2024
@AsimSafarli
Copy link

<Autocomplete
options={data}
getOptionLabel={(item) => item.title}
renderInput={(params) => <TextField {...params} label="Choose an option" />}
key={(item) => item.id} {'mock data use uuid '}
/>

@zannager zannager added the component: autocomplete This is the name of the generic UI component, not the React module! label Sep 17, 2024
@mnajdova
Copy link
Member

mnajdova commented Oct 2, 2024

It doesn't look like this bug report has enough info for one of us to reproduce it.
Please provide a CodeSandbox (https://material-ui.com/r/issue-template-latest), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

@mnajdova mnajdova added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 2, 2024
Copy link

github-actions bot commented Oct 9, 2024

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

@github-actions github-actions bot closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

5 participants