-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
fix: headings having duplicate keys #8348
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a React duplicate key warning issue that occurred when article headings share the same text content. The fix changes the list key from the heading text (head.value) to the unique heading ID (head.data?.id) generated by the rehype-slug plugin.
- Changed the React key for heading list items from text-based to ID-based to ensure uniqueness
- Improved consistency in optional chaining syntax for the href attribute
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8348 +/- ##
=======================================
Coverage 76.76% 76.76%
=======================================
Files 118 118
Lines 9822 9822
Branches 335 335
=======================================
Hits 7540 7540
Misses 2280 2280
Partials 2 2 ☔ View full report in Codecov by Sentry. |
|
@efekrskl you can do a rebase or make an empty commit so Vercel triggers a new preview, please?. I’m not sure why it failed on Vercel, but it seems that everything is fine in the GitHub action. If the error keeps happening, let us know on Slack |
Yup, seems to be working fine now |
Description
Fixes a minor issue where article headings could have duplicate keys, when they share the same title (e.g https://nodejs.org/en/learn/test-runner/mocking, https://nodejs.org/en/learn/diagnostics/memory)
Validation
Related Issues
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.