Zum Hauptinhalt springen

Component and JSX quick fixes

Recall core component and JSX rules that prevent beginner React errors.

react-basics5 min read

Component identity Why must React component names start with a capital letter? Capitalized JSX tells React to render your component instead of treating the tag as a built-in HTML element. Use ProfileCard, not profileCard, when rendering `. JSX attribute Which JSX attribute is right for CSS classes? JSX is JavaScript syntax, so several attribute names differ from HTML. Accessibility objection The search button only has an icon. Sighted users understand it. Icon-only controls need an accessible name for screen readers and speech input. Your fix Add aria-label='Search customers' or visible text that names the action. Do not label it magnifying…

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Kontakt aufnehmen