React/Getting Started/Lesson 02
JSX Syntax
25 min·theory
This chapter
2/2
JavaScript
JSX Syntax
💡 Why Should You Learn This?
🎯
This is essential syntax for building websites with React.
💼
It is easy to learn because it mixes HTML and JavaScript together.
⚡
It is the foundational skill that every React developer uses every day.
🏢 실무에서는
In professional practice, JSX is used to build UI elements such as buttons, forms, and cards. For example, an e-commerce developer writes a product listing screen in JSX, which is then compiled into JavaScript code and rendered in the browser.
What Is JSX? — JavaScript That Looks Like HTML
JSX is a syntax for writing UI that looks like HTML, right inside JavaScript.
Browsers don't understand JSX, so Vite/Webpack automatically transforms it for you:
> 💡 It's enough to think of it as "just write it like HTML."
Using JavaScript in JSX — Curly Braces {}
To use a JavaScript expression inside JSX, wrap it in curly braces {}.
⚛️ React Pattern — JSX Syntax
Follow along step by step with code examples to see how JSX syntax is used in React.
1
🧩
1. JSX Syntax Use Case
Situations where this feature is needed.
↓
2
💻
2. Writing the Code
Basic usage of JSX syntax.
↓
3
🎨
3. Rendered Result
What the user sees on screen.
↓
4
💡
4. Pro Tips
Common pitfalls and best practices.
🎮 JSX Syntax — Step-by-Step Understanding
Click each step to read the content, then use the ✓ Got it button to track your progress.
🖥️ Result — rendered React component
✏️ React 코드 수정하기 (클릭해서 열기)
⚛️ React 18 + Babel Standalone — see the result first, then edit the code yourself.
Check Your Understanding
What is the correct way to specify a CSS class in JSX?
Read this first: Introduction to React
Up next: Component Basics