reactjs / reactjs/react.dev

Warning about FooterLink keys in dev

Đang mở
#472 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
JavaScript
Star
11.8k
Fork
7.9k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
11

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Mở src/components/LayoutFooter/Footer.js tại các phần tử FooterLink ở dòng 67 và 115, sau đó chạy yarn dev và truy cập localhost:8000. Xác nhận rằng console của trình duyệt không còn báo cảnh báo thiếu khóa duy nhất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, react
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.