studiobakers / react-ui-toolkit

Bakers Studio's React-based UI Toolkit
MIT License
15 stars 2 forks source link

List: key uses array index by default #177

Closed edizcelik closed 2 years ago

edizcelik commented 2 years ago

We are currently using testid as the default key prop for each list item. This causes tracking issues if the provided items do not have an id property and if there was no key generator function was provided. I think we should initiate the key variable with undefined and then generate a unique string for it if there is no available id property in the item object or there was no listItemKeyGenerator provided as a prop. https://github.com/Hipo/react-ui-toolkit/blob/main/src/list/List.tsx#L39

yasincaliskan commented 2 years ago

Solution: