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

Replace key={index} in Mapping with Unique Identifiers #3646

Closed
eriwarr opened this issue Sep 10, 2024 · 0 comments · Fixed by #3688
Closed

Replace key={index} in Mapping with Unique Identifiers #3646

eriwarr opened this issue Sep 10, 2024 · 0 comments · Fixed by #3688
Assignees
Labels
cleanup Code health cleanups

Comments

@eriwarr
Copy link
Collaborator

eriwarr commented Sep 10, 2024

Background

Currently, we have several instances in our codebase where key={index} is used when rendering lists with the .map() function. While using the index as a key works, it can lead to performance issues and bugs when the list changes. Using a unique identifier as the key is recommended to ensure that React can efficiently track which items have changed, added, or removed.

Proposed Solution

Replace index with unique keys.

Screenshots / Mockups

If applicable, add images for mockup purposed

How will this move the needle on health equity?

Performance improvement for the site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code health cleanups
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant