Beginner React Interview QuestionsBeginnerConcept
React · Question 3
What is a React component?
Direct answer
A React component is a reusable unit of UI, typically written as a JavaScript function that returns JSX.
A component receives inputs such as props and can use React features such as state and context to calculate the JSX it returns.
UserCard.jsx
function UserCard({ name }) {
return (
<article>
<h2>{name}</h2>
</article>
);
}