Codepen Reproduction :
Codepen Link
Grouped List creates divs where it uses the name of the groups as keys. It throws duplicate key errors in the console ( it happens in the codepen provided too)
Grouped List should use the key provided to the group as the key
Are you willing to submit a PR to fix? (Yes, No): I don't know how to fix it yet
Requested priority: (Blocking, High, Normal, Low)
tagging @KevinTCoughlin
The source of the problematic key is _getPageSpecification() in GroupedList.base.tsx which only uses pageGroup.name to generate the key. A potential fix is to use pageGroup.key if present and only fall back to pageGroup.name if key is not present.
The source of the problematic key is
_getPageSpecification()inGroupedList.base.tsxwhich only usespageGroup.nameto generate the key. A potential fix is to usepageGroup.keyif present and only fall back topageGroup.nameif key is not present.
Thanks @JasonGore, made implementing the fix super easy 馃憤. Adding unit tests now and will PR.
return {
key: pageGroup && (pageGroup.key || pageGroup.name)
};
Actually, since IGroup.key is required and meant for providing a unique key whereas name is not I _may_ opt to not default here.
return {
key: pageGroup && pageGroup.key
};
:tada:This issue was addressed in #6979, which has now been successfully released as [email protected].:tada:
Handy Links:
Most helpful comment
The source of the problematic key is
_getPageSpecification()inGroupedList.base.tsxwhich only usespageGroup.nameto generate the key. A potential fix is to usepageGroup.keyif present and only fall back topageGroup.nameif key is not present.