react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

Update confusing conditional-rendering.md

Open Cragt opened this issue 1 year ago • 2 comments
trafficstars

This pull request addresses a potential confusion in the documentation regarding conditional rendering in React. The original warning stated not to put numbers on the left side of '&&,' but the provided example still included a number to the left of '&&'. This caused confusion.

Changes Made:

Updated the wording in the documentation to emphasize the importance of having a boolean expression on the left side of '&&' for conditional rendering.
Provided a clearer example to illustrate the issue with using numbers, especially 0, on the left side of '&&.'
Ensured that the revised explanation accurately reflects the behavior of conditional rendering in React.

Why: The goal is to improve the clarity of the documentation and prevent potential misunderstandings for developers using React. The revised wording better communicates the nuances of using '&&' for conditional rendering, especially when dealing with numbers.

Cragt avatar Feb 06 '24 04:02 Cragt

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-dev ✅ Ready (Inspect) Visit Preview Feb 6, 2024 4:27am

vercel[bot] avatar Feb 06 '24 04:02 vercel[bot]

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

github-actions[bot] avatar Feb 06 '24 04:02 github-actions[bot]