Interview Q&A / React
React interview questions
Rendering, state, hooks, keys and effects, explained with small examples.
Prefer rapid revision? Practise React short interview answers →
- How do you use JavaScript expressions inside JSX, and what cannot go inside the braces?
Curly braces accept any JavaScript expression: a variable, a function call, a ternary. Statements such as if, for or switch are not expressions, so they must live outside the JSX.
BeginnerQuick answer1 min read