JSX Expression
Question
What is JSX?
Hint
JSX is syntactic sugar for React.createElement.
Explanation
JSX is a syntax extension for JavaScript that allows writing HTML-like markup directly in JS. It is not valid JavaScript — it must be compiled (by Babel or TypeScript) to React.createElement() calls. JSX makes component code more readable. Expressions are embedded with curly braces: {variable}. JSX is closer to JavaScript than to HTML — attributes use camelCase (className, onClick).
Related Resources
Related Lessons
- JSX Basics
Learn JSX.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.