Which statement about JSX naming is true?

Master ReactJS with our comprehensive test. Practice with multiple-choice questions and detailed explanations. Build your skills for the exam with our engaging format and expert tips!

Multiple Choice

Which statement about JSX naming is true?

Explanation:
In JSX, capitalization signals what you’re rendering: HTML-like elements are lowercase, while React components start with an uppercase letter. This distinction lets React know how to treat each tag. Lowercase names like div, span, or p map directly to native DOM elements and will render as standard HTML. Names that begin with an uppercase letter, such as MyButton or UserCard, refer to React components (functions or classes) that you’ve defined; React will call or instantiate them to render their returned elements. If you used a lowercase name for a component, React would interpret it as a plain DOM tag, not as a component, which isn’t what you want. This is why the statement about HTML-like elements starting lowercase and components starting uppercase is the true rule.

In JSX, capitalization signals what you’re rendering: HTML-like elements are lowercase, while React components start with an uppercase letter. This distinction lets React know how to treat each tag. Lowercase names like div, span, or p map directly to native DOM elements and will render as standard HTML. Names that begin with an uppercase letter, such as MyButton or UserCard, refer to React components (functions or classes) that you’ve defined; React will call or instantiate them to render their returned elements. If you used a lowercase name for a component, React would interpret it as a plain DOM tag, not as a component, which isn’t what you want. This is why the statement about HTML-like elements starting lowercase and components starting uppercase is the true rule.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy