Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Fix key attribute while showing links on statistics page #10179

Conversation

itsaakashpatel
Copy link
Contributor

Fixes Issue

Closes: #9906

Changes proposed

  • The issue was not to have a unique key for each link while displaying the list of links.
  • A link.url will be the same when two or more links are identical. In this scenario, React lacks a unique key for each item in the list, posing a problem.
  • I opted for link._id, a unique ID assigned to each link from the database, to address this issue.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Before:

1706136695

After:

1706138123

Note to reviewers

None

@github-actions github-actions bot added the issue linked Pull Request has issue linked label Jan 24, 2024
Copy link
Member

@ThomasCode92 ThomasCode92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed solution appears effective, but I'm curious about the reason for having repeated links in the list?

@itsaakashpatel
Copy link
Contributor Author

itsaakashpatel commented Jan 26, 2024

The proposed solution appears effective, but I'm curious about the reason for having repeated links in the list?

Thanks for approving the changes. I was thinking the same, and I decided to create a new issue to ask the product team to understand the reason behind it. Ideally, one link should suffice for each platform.

Copy link
Member

@sital002 sital002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍
Thank you for the contribution

@sital002 sital002 merged commit 01c39ee into EddieHubCommunity:main Feb 6, 2024
13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue linked Pull Request has issue linked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] two children with same key error in statistics page
3 participants