AceDevHub
Beginner React Interview QuestionsBeginnerConcept

React · Question 5

What is JSX in React?

Direct answer

JSX is a JavaScript syntax extension that lets you write HTML-like markup inside JavaScript and is transformed into the element descriptions React renders.

JSX is not HTML and it is not a separate templating language. It lets rendering logic and markup stay together inside a component.

Greeting.jsx
const user = "Aisha";

export default function Greeting() {
  return <h1>Hello, {user}</h1>;
}