All jobs / Frontend / web developer / React
Frontend / web developer interview question · 0–1 years
What is JSX, and what does the browser actually receive?
The strongest answer
A syntax for describing UI that compiles to function calls creating element objects; the browser never sees JSX — a build step turns it into plain JavaScript
Why it works
Right. Sugar over createElement; the compiler does the translation.
What a good answer covers
- JSX compiles to element-creating calls.
- Expressions in braces are JavaScript.
- className, not class.
- A build step is required.
Answers that fall short
- Close, but not the strongest: HTML that React copies into the page
It looks like HTML but is JavaScript expressions producing objects. - Weak: A template language the browser understands natively
Browsers do not parse JSX. - Red flag: A CSS preprocessor
Nothing to do with styling.
Who gets asked this
More React questions
- What is the difference between props and state?
- What does useState return, and why must you call the setter instead of assigning?
- Why does React warn about a missing key when you render a list?
- What is a controlled input?
- What is useEffect for?
- What happens if useEffect has an empty dependency array, and if it has none at all?
- How do you render something only when a condition holds?
- Why does onClick={handleClick()} fire during render instead of on click?