JSX (JavaScript XML) is a syntax extension for JavaScript that allows you to write HTML-like code within JavaScript. It makes React components more readable and easier to write.
JSX gets transpiled to React.createElement() calls by tools like Babel:
// JSX
const element = <h1>Hello, World!</h1>;
// Transpiled to
const element = React.createElement('h1', null, 'Hello, World!');
Benefits of JSX:
More intuitive and readable than React.createElement()
Allows mixing of HTML-like syntax with JavaScript expressions
Provides better error messages and warnings
Enables static type checking
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.