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

Add key to stylesheet links in Head.js #425

Merged
merged 2 commits into from
Feb 1, 2018
Merged

Conversation

hshoff
Copy link
Contributor

@hshoff hshoff commented Jan 30, 2018

Motivation

I was adding a google font through siteConfig.stylesheets and noticed the following error:

Starting Docusaurus server on port 3000...
Open http://localhost:3000/
Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `Head`. See https://fb.me/react-warning-keys for more information.
    in link (created by Head)
    in Head (created by Site)
    in html (created by Site)
    in Site (created by DocsLayout)
    in DocsLayout

This fixes that by adding the key prop. Following the same style as used for siteConfig.scripts

Test Plan

  • ran npm run prettier
  • npm run test pass
  • verified with npm link that error message was gone with this patch applied

Copy link
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

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

@hshoff Thank you very much. I have been wanting to fix this for a while, and just kept putting it off.

I think this is a reasonable way to do the key.

cc @hramos Do you see a problem with this? I am going to merge it, but we can change it if you think it is a problem.

@JoelMarcey JoelMarcey merged commit c6a9848 into facebook:master Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants