[Suggestion]: Correction of misleading explanation in react.dev/learn (Quick Start)
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 11.8k
- Forks
- 7.9k
- Merge moyen
- 1 j 11 h
- PR mergées (30 j)
- 11
Description
Summary
In the image above, the highlighted text implying that if statements don't work in JSX is misleading. As this is a resource that will be used by a lot of developers looking to learn React, I believe it would be beneficial to the community to clarify the information that was intended to be passed on to readers
Page
Details
As stated earlier in the page—code inside the curly braces is actually JavaScript. In the context of the highlighted text one could be led to believe that using if statements in a JSX file simply won't work or using it inside the curly braces also won't work which are both inaccurate. It is important for someone new to JSX to understand that the code inside the curly braces is supposed to be an expression.
Simply explaining that the js inside the curly braces must be an expression that returns a value, in this case—a markup should help the user better understanding why we shouldn't use an if statement directly in there.
Thank you for your time.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la page react.dev/learn liée et localisez l’explication mise en évidence dans Quick Start. Examinez la formulation JSX et JavaScript environnante, puis clarifiez la distinction entre les expressions à l’intérieur d’accolades et les instructions if directes ; la page doit expliquer correctement pourquoi l’exemple est écrit ainsi.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, react
- Domaine
- documentation
- Type d'issue
- Documentation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 50/100