Select considering value instead of key
See original GitHub issueVersion
3.2.0
Environment
win10, chrome 64
Reproduction link
https://codesandbox.io/s/k2qmqnxrzv
Steps to reproduce
Select with many options where the key is a uuid and value is a number but with repeated values.
What is expected?
No errors
What is actually happening?
Error in console :
Warning: Encountered two children with the same key, .$1
. 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.
in ul (created by DOMWrap)
in DOMWrap (created by Menu)
in Menu (created by DropdownMenu)
in div (created by DropdownMenu)
in DropdownMenu (created by SelectTrigger)
in LazyRenderBox (created by PopupInner)
in div (created by PopupInner)
in PopupInner (created by Popup)
in Align (created by Popup)
in AnimateChild (created by Animate)
in Animate (created by Popup)
in div (created by Popup)
in Popup (created by Trigger)
in Portal (created by Trigger)
in Trigger (created by SelectTrigger)
in SelectTrigger (created by Select)
in Select (created by LocaleReceiver)
in LocaleReceiver (created by Select)
in Select (created by TestSelect)
in div (created by TestSelect)
in TestSelect
in div
If the key is always different, the value in the option should not interfer with the react key (because it is not even mandatory, only the key is). Sorry if i’m missing something and thank you!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:14 (9 by maintainers)
Top GitHub Comments
And value should be unique.
@yesmeck 不是一两个人提这种需求了,其他框架中的select 也没有像这么玩的。你们团队应该好好讨论一下