-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
fix(theme-classic): add key prop for SimpleLinks map #6515
fix(theme-classic): add key prop for SimpleLinks map #6515
Conversation
✔️ [V2] 🔨 Explore the source changes: 68fb648 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61f6c00dbe75680008cfbf3f 😎 Browse the preview: https://deploy-preview-6515--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6515--docusaurus-2.netlify.app/ |
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.
Thanks!
@@ -106,10 +106,9 @@ function SimpleLinks({links}: {links: SimpleFooter['links']}) { | |||
return ( | |||
<div className="footer__links"> | |||
{links.map((item, key) => ( | |||
<> | |||
<React.Fragment key={key}> |
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.
Looks like we could prevent this with ESLint rule (disabled by default atm):
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.
Interestingly, this rule is disabled in airbnb because of "false positives". I think we can enable some React rules ourselves
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.
honnestly I never liked eslint airbnb, and many people have the same feeling
In the long term we should remove it imho
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.
I like it as a solution that just works... We aren't tied to it (while many others are forced to have a style guide and stick to it) so we can tweak it however we want
Motivation
Fixes #6509
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Confirmed console error does not occur anymore