What is React JSX and its Key Features?

React JSX (JavaScript XML) is a syntax extension for JavaScript that allows you to write HTML-like code within JavaScript. JSX makes it easier to create React components and define their structure in a more readable and declarative way.

1. HTML-like Syntax: JSX looks similar to HTML but is transpiled into JavaScript functions by tools like Babel.

const element = <h1>Hello, world!</h1>

2. Embedding Expressions: You can embed JavaScript expressions inside JSX using curly braces {}.

const name = "John"; const element = <h1>Hello, {name}!</h1>;

3. Attributes: JSX allows you to pass attributes to elements. These attributes are camelCase for consistency with JavaScript conventions.

const element = <button onClick={handleClick}>Click Me</button>;

4. Styling: Inline styles are written as objects in JSX.

const style = {color: 'blue', fontSize: '20px' };
const element = <h1 style={style}>Styled Text</h1>;

5. JSX Compilation: Under the hood, JSX is converted into React.createElement calls.

const element = <h1>Hello, world!</h1>;
Compiles to:
       javascript
const element = React.createElement('h1', null, 'Hello, world!');