reactjs / reactjs/react.dev

Tutorial: make clear warnings are to be found in dev console

Aperta
#1,163 6 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

I'm completely new to react and when I tried following https://reactjs.org/tutorial/tutorial.html , everything went smoothly except at the part before "Picking a Key" where it says

For now, we should see a list of the moves that have occurred in the game and a warning that says:

Warning: Each child in an array or iterator should have a unique “key” prop. Check the render method of “Game”.

I didn't realize codepen example had secretly overridden console.log to display the error msg in the page itself, so I thought I should be seeing the warning on my test page as well. I spent a long time looking for it, reexamining my code and setup, etc etc, and finally ended up asking and getting an answer on stackoverflow.

It's silly how the simplest things can become impossible hurdle for beginners who are learning on their own. I think a clarification that 1. for people following along with their own dev environment, this is to be found in the browser's developer console, and 2. the codepen example had changed console.log behavior but that's not the default to be expected.

Thank you very much.

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

Inizia con la sezione del tutorial di React immediatamente precedente a «Picking a Key» e confronta l'esempio CodePen con le istruzioni per un ambiente di sviluppo locale. Chiarisci che l'avviso appare nella console per sviluppatori del browser e che CodePen sovrascrive console.log per visualizzarlo nella pagina; il lavoro è completato quando è improbabile che i principianti cerchino l'avviso nella loro pagina.

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

Valutazione

Stack tecnologico
javascript, react
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
1/5
Tempo stimato
Meno di un'ora
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.