reactjs / reactjs/react.dev

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

Aperta
#8,416 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug: unconfirmed
Lingua principale
JavaScript
Stelle
11.8k
Fork
7.9k
Merge medio
1g 11h
PR unite (30g)
11

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Esamina src/components/Layout/HomeContent.js e src/components/MDX/MDXComponents.tsx, quindi esegui il comando di lint per esaminare le sette occorrenze segnalate. Sostituisci gli elementi img grezzi appropriati con next/image, gestendo con attenzione il rendering MDX, e verifica che gli avvisi @next/next/no-img-element siano stati risolti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, next.js
Ambito
documentation, frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.