-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(netlify-cms-core): duplicate key warning #1930
Conversation
Deploy preview for netlify-cms-www ready! Built with commit 0336614 |
Deploy preview for cms-demo ready! Built with commit 0336614 |
The index can change, so it isn't a reliable key. The slug should be unique, but it is possible for two entries from different collections to have the same slug. If you update to something like |
Yes I know the index key isn't reliable, but we are using it as keys in other places in the app 😊. So you want us to use |
We use the index in other places if we know the order of a list won't change, in which case it's safe to use. This isn't one of those cases, so we need to consider what will be ensured unique. I believe |
Updated the key to |
Thanks @barthc! Were you were able to confirm it addresses the bug you encountered? |
@erquhart yes it did fix the bug. |
Awesome 👍👍 |
* official/master: update release ticker Publish feat: add cloudinary support (decaporg#1932) fix(netlify-cms-core): duplicate key warning (decaporg#1930) Update image.md (decaporg#1923) chore(netlify-cms-core): upgrade react-frame-component to 4.x (decaporg#1925) chore(netlify-cms-core): upgrade gray-matter to 4.x (decaporg#1924) feat(netlify-cms-widget-select): add support for multiple selection (decaporg#1901) # Conflicts: # packages/netlify-cms-widget-select/package.json # packages/netlify-cms/src/media-libraries.js
…-config * official/master: (48 commits) docs: fix broken link to dev configuration file (decaporg#1941) docs: link releases to tag comparisons update release ticker Publish feat: add cloudinary support (decaporg#1932) fix(netlify-cms-core): duplicate key warning (decaporg#1930) Update image.md (decaporg#1923) chore(netlify-cms-core): upgrade react-frame-component to 4.x (decaporg#1925) chore(netlify-cms-core): upgrade gray-matter to 4.x (decaporg#1924) feat(netlify-cms-widget-select): add support for multiple selection (decaporg#1901) chore: improve publish scripts Publish chore: test before publishing chore(netlify-cms-core): upgrade react-dnd to 7.x (decaporg#1922) chore(netlify-cms-widget-text): upgrade to react-textarea-autosize 7.x (decaporg#1921) chore(netlify-cms-core): upgrade to react-waypoint 8.x (decaporg#1920) fix(backend): use singular label in custom commit message (decaporg#1917) docs: add GAE-specific oAuth client (decaporg#1918) fix(netlify-cms-widget-text): set correct font family (decaporg#1916) chore(netlify-cms-core): upgrade redux and related dependencies (decaporg#1914) ...
Summary
Fix the console warning on the workflow page
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.
that shows up when two entry from different collections both have the same slug. The issue shows for
test-repo
backend, not sure it would be the same case forgithub
backend.