reactjs / reactjs/react.dev

Warning about FooterLink keys in dev

Open
#472 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

There is a warning in the browser console when running the project in development mode. The warning can be fixed by adding a key prop to FooterLink elements here and here. If this should be fixed I will submit a PR to do so.

Warning text:

index.js:2177 Warning: Each child in an array or iterator should have a unique "key" prop.

Check the render method of `Footer`. See https://fb.me/react-warning-keys for more information.
    in FooterLink (at Footer.js:67)
    in Footer (at index.js:69)
    in div (at index.js:45)
    in Template (at index.js:6)
    in _default (created by ComponentRenderer)
    in ComponentRenderer (created by Route)
    in Route (created by withRouter(ComponentRenderer))
    in withRouter(ComponentRenderer) (created by Root)
    in ScrollContext (created by Route)
    in Route (created by withRouter(ScrollContext))
    in withRouter(ScrollContext) (created by Root)
    in Router (at root.js:143)
    in DefaultRouter (created by Root)
    in Root (at app.js:45)
    in AppContainer (at app.js:44)

Steps to reproduce:

  1. Checkout master branch
  2. Run yarn dev
  3. Navigate to localhost:8000 and look in the browser console

Browser: Chrome 63
OS: MacOS 10.13.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open src/components/LayoutFooter/Footer.js at the FooterLink elements on lines 67 and 115, then run yarn dev and visit localhost:8000. Confirm that the browser console no longer reports the missing unique key warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.