How React renders · core
Components, elements and JSX
A component is a function that returns a description of the UI; JSX compiles to plain function calls that create element objects, and React (not you) calls your component later to render it.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- JSX compiles to
jsx(type, props)calls fromreact/jsx-runtime(the "new JSX transform", which React 19 requires). The result is a plain object called a React element: roughly{ type, props, key }. - A component is a function that takes props and returns React nodes: elements, strings, numbers, arrays,
null. Its name starts with a capital letter, so JSX treats<Card />as a component and<div />as an HTML tag. - Creating an element does NOT call the component. React calls it later, during render. "Rendering" means React calling your function.
- Three words: a React node is anything React can render; a React element is the object that
<X />creates; a component is the functionXitself. - Props are read-only inputs. Data flows down through props; changes flow up through callback props (one-way data flow).
- React 19:
refis a normal prop now, soelement.refis deprecated (readelement.props.ref).propTypesanddefaultPropson function components were removed; use TypeScript and default parameters.
The red pen
Common traps: mistake → fix
Mistake: "JSX is HTML inside JavaScript"
Fix: it is syntax that compiles to function calls that return plain objects; that is why it uses
classNameandhtmlFor.Mistake: "
<Child />calls Child immediately"Fix: it only creates an element object; React decides when, and how many times, to call Child.
Mistake: "
{Child()}is the same as<Child />"Fix: calling it directly makes Child's hooks belong to the parent and removes its own identity, so its state and keys behave differently.
Easy to hard
Questions interviewers ask, easy to hard
- What is JSX and what does it compile to?
- What is the difference between a React node, a React element and a component?
- What does React actually do when it "renders" a component?
- Why is
{Child()}different from<Child />if both return the same JSX?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.