JSX 2.0 and Declarative UI
In this tutorial, we will learn what JSX 2.0 is, why it matters, and how it helps you build user interfaces in a simple, predictable way. Everything will be explained in clear language, so even if you are new to React, you will understand the concepts easily.
What Is JSX 2.0?
JSX is the syntax that lets you write HTML-like code inside JavaScript. It looks like HTML, but it works like JavaScript.
Example:
<h1>Hello world</h1>React 19 introduced JSX 2.0, which keeps the familiar syntax but improves how React understands and optimizes your components.
You do not need to learn a new language. JSX 2.0 just makes your existing code clearer and more efficient.
What Does Declarative UI Mean?
React is declarative. That means you describe what you want the UI to look like, and React figures out how to update the screen.
Imagine giving instructions like this:
Instead of: “Walk to the kitchen, open the fridge, take out the drink, pour it.”
Declarative style says: “I want a glass of lemonade.”
React handles the steps.
Here is a declarative component:
export default function Greeting({ name }) {
return <h1>Hello {name}</h1>;
}You describe the final UI. React does the work to display it.

JSX 2.0 Makes Declarative UI Even Simpler
React 19 improves JSX so the compiler can optimize your components automatically.
You no longer need to write things like:
- useMemo
- useCallback
- React.memo
The compiler handles performance for you as long as your component is written cleanly and uses its inputs directly.
Example:
export default function UserCard({ user }) {
return (
<section>
<h2>{user.name}</h2>
<p>{user.email}</p>
</section>
);
}This is already optimized. No extra code needed.
Metadata Inside JSX (A New Concept)
React 19 allows you to write metadata like <title> and <meta> directly inside your component.
This keeps all page related information in one place.
Example:
export default function Page() {
return (
<>
<title>Welcome Page</title>
<meta name="description" content="Beginner friendly example" />
<h1>Hello and welcome</h1>
</>
);
}Previously, you needed separate files or frameworks for this. JSX 2.0 now supports it directly.
Key Ideas to Remember
- JSX 2.0 still looks like the JSX you know.
- Declarative UI means you describe the result, not the steps.
- Metadata now lives directly inside JSX.
- React Compiler handles performance, not you.
When you focus on writing simple components, React takes care of the rest.
JSX 2.0 makes React easier for beginners by reducing complexity, allowing metadata inside JSX, and improving performance automatically. With the declarative UI model, you only need to describe what you want your interface to look like, and React handles the details.