React · Frontend system thinking
What is the difference between a React element and a component?
Short answer
An element is an immutable description of UI, such as what type to render and which props to use. A component is a function or class that returns elements.
Elements are plain objects. They are cheap to create and describe what should appear. A component is the reusable code that produces those elements, often using props, state and hooks.
const element = <h1>Hello</h1>;
function Greeting({ name }) {
return <h1>Hello, {name}</h1>;
}
const componentElement = <Greeting name="Asha" />;Why the distinction matters
- Elements are immutable; you create a new one on each render
- Components can hold state, run effects and return different elements over time
- An element's
typecan be a string for a DOM tag or a function for a component - React instances are the internal state associated with a mounted component
A common interview trap is saying an element is a component instance. It is not. An element is a description; React creates and manages the instance when it renders that description.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Can you mutate a React element?
- 2What is a component instance?
- 3What is the `type` field on an element?
- 4Why are elements cheap to create?
Say it in the interview
A React element is an immutable object that describes UI, including the type and props. A component is a function or class that returns elements and can hold state and effects. Elements are created constantly during render; components are the reusable units that produce them. An element is not a component instance, which is React's internal mounted state.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live React mock interview and get scored feedback on depth, clarity and confidence.