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

List: key uses array index by default #177

Closed
edizcelik opened this issue Jan 13, 2022 · 1 comment
Closed

List: key uses array index by default #177

edizcelik opened this issue Jan 13, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@edizcelik
Copy link
Contributor

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

@edizcelik edizcelik added the bug Something isn't working label Jan 13, 2022
@edizcelik edizcelik changed the title ListItem: key uses array index by default List: key uses array index by default Jan 13, 2022
@yasincaliskan
Copy link
Contributor

yasincaliskan commented Jan 13, 2022

Solution:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants