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

Warning: Each child in an array or iterator should have a unique "key" prop. when using Code Tabs #1255

Closed
vieira opened this issue Mar 3, 2019 · 5 comments · Fixed by #1284
Labels
bug An error in the Docusaurus core causing instability or issues with its execution difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.

Comments

@vieira
Copy link

vieira commented Mar 3, 2019

🐛 Bug Report

Getting a warning: Each child in an array or iterator should have a unique "key" prop. when opening a page that uses Language-specific Code Tabs, version 1.7.2.

To Reproduce

Note: In the example below I added some spaces between ` to avoid breaking the style. In the markdown file I am using there are no such spaces.

<!--DOCUSAURUS_CODE_TABS-->
<!--JavaScript-->
` ` `js
// some js code
}
` ` `
<!--Python-->
` ` `python
# some python code
` ` `
<!--END_DOCUSAURUS_CODE_TABS-->

Run docusaurus-start and visit the page.

Expected behavior

No warnings are printed in the console.

Actual Behavior

The following warnings are logged:

$ docusaurus-start
LiveReload server started on port 35729
Docusaurus server started on port 3000
Warning: Each child in an array or iterator should have a unique "key" prop.

Check the top-level render call using <article>. See https://fb.me/react-warning-keys for more information.
    in MarkdownBlock
    in Doc
    in div
    in div
    in Container
    in div
    in div
    in body
    in html
    in Site
    in DocsLayout
Warning: Each child in an array or iterator should have a unique "key" prop.

Check the top-level render call using <div>. See https://fb.me/react-warning-keys for more information.
    in div
    in MarkdownBlock
    in article
    in div
    in Doc
    in div
    in div
    in Container
    in div
    in div
    in body
    in html
    in Site
    in DocsLayout

Reproducible Demo

Problem can be seen in the docs/webhooks/examples.html and docs/webhooks/start.html pages.

@endiliey endiliey added the bug An error in the Docusaurus core causing instability or issues with its execution label Mar 4, 2019
@endiliey
Copy link
Contributor

endiliey commented Mar 4, 2019

cc @fiennyangeln

@yangshun
Copy link
Contributor

yangshun commented Mar 4, 2019

This should be quite an easy fix. Anyone is free to take it up 😄

@yangshun yangshun added the difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. label Mar 4, 2019
@oneuptim
Copy link

oneuptim commented Mar 5, 2019

@yangshun I'd like to scoop this one up!

@yangshun
Copy link
Contributor

yangshun commented Mar 5, 2019

@oneuptim it's yours!

I've added an "issue: claimed" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim.

I'll check in with you periodically so that we can keep the task updated with the progress.

@oneuptim
Copy link

oneuptim commented Mar 5, 2019

Sounds good! Thanks!

alexkrolick added a commit to alexkrolick/Docusaurus that referenced this issue Mar 17, 2019
alexkrolick added a commit to alexkrolick/Docusaurus that referenced this issue Mar 17, 2019
alexkrolick added a commit to alexkrolick/Docusaurus that referenced this issue Mar 17, 2019
yangshun pushed a commit that referenced this issue Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants