DEV Community

Aman Kureshi
Aman Kureshi

Posted on

🧠 What is JSX in React?

JSX stands for JavaScript XML. It lets you write HTML-like code inside JavaScript, making UI creation easier in React.

πŸ“˜ Example:

function App() {
  const name = "Aman";

  return <h1>Hello, {name}</h1>;
}
Enter fullscreen mode Exit fullscreen mode

✨ Key Points:
β€’ JSX looks like HTML but works inside JavaScript
β€’ You can use JavaScript expressions with {}
β€’ JSX is converted into React.createElement() behind the scenes

JSX makes React code more readable and developer-friendly. πŸš€

Top comments (0)