🌐JavaScript XML (JSX)
Also known as JSX, TSX, React JSX
HTML-like tags written inside JavaScript. A build step turns them into code.
Think of it like
Think of it like a recipe card with pictures. It looks like the dish, but it is still a set of steps.
Example
Why it matters
React and many other tools use it to describe what each part of the screen looks like. It keeps the look and the logic side by side.
Definition
Example code
jsx
function Greeting({ name }) {
return <h1 className="title">Hi {name}</h1>;
}Common mistake
Key takeaways
- 1Looks like HTML. But it lives inside JavaScript.
- 2Curly braces. They drop JavaScript values into the tags.
- 3Needs a build step. Browsers cannot read it as it is.