reactjs / reactjs/react.dev

[Bug]: Replace <img> tags with next/image to satisfy Next.js lint warnings

Đang mở
#8,416 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.

bug: unconfirmed
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ả

Summary

The project currently triggers @next/next/no-img-element lint warnings because raw <img> tags are used in a few components. These should be reviewed and replaced with Image from next/image where appropriate.

Page

N/A

Details

Running the lint command reports @next/next/no-img-element warnings in the following files:

  • src/components/Layout/HomeContent.js
  • src/components/MDX/MDXComponents.tsx

Warning count:

  • HomeContent.js: 4 occurrences
  • MDXComponents.tsx: 3 occurrences

Using raw <img> elements in a Next.js app bypasses built-in image optimization and triggers lint warnings. Replacing them with Image from next/image would align the codebase with Next.js best practices.

Note:
Some usages, especially in MDX-related rendering, may require additional handling and should be updated carefully rather than through a blind replacement.

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

Kiểm tra src/components/Layout/HomeContent.js và src/components/MDX/MDXComponents.tsx, sau đó chạy lệnh lint để xem xét bảy vị trí được báo cáo. Thay thế các phần tử img thô phù hợp bằng next/image, đồng thời xử lý việc render MDX cẩn thận, và xác nhận rằng các cảnh báo @next/next/no-img-element đã được giải quyế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, next.js
Lĩnh vực
documentation, frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/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.