How do props make React components reusable?
Props let you pass data into a component so it can render differently based on that data. A greeting component that takes a name prop can greet anyone, instead of being hardcoded to one name.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in How to Create Your First React Components From Scratch
Write a JavaScript function whose name starts with a capital letter, and have it return JSX. You can then use that function name as a custom tag inside other components.
Because React uses capitalization to distinguish custom components from built-in HTML tags. A lowercase name is treated as a DOM tag like div, while a capitalized name is treated as a component.
Not directly. A component must return a single root. To return siblings without an extra wrapper element, use a React fragment, written as empty angle brackets.
Still have questions?
Browse all our FAQs or reach out to our support team
