liveBook · Manning

JSX

As explained in React Hooks in Action: With Suspense and Concurrent Mode

JSX is a JavaScript syntax extension for describing user-interface elements with an HTML-like notation.

JSX is an HTML-like syntax for describing user-interface elements inside JavaScript. It supports React’s reusable, composable component model while keeping UI structure close to related code. section 1.1 section 1.1.1

Quiz interface

A quiz can reuse TextToggle for both question and answer content: <TextToggle title="Question" text="Who created JavaScript?" show={true} /> and <TextToggle title="Answer" text="Brendan Eich" show={false} />. JSX is preprocessed into JavaScript before the app runs, commonly with Babel. section 1.1.1

<TextToggle title="Question" text="Who created JavaScript?" show={true} />

<TextToggle title="Answer" text="Brendan Eich" show={false} />

Inspect the compact JSX listing showing component reuse, props, text values, and Boolean display state. section 1.1.1

How React Hooks in Action: With Suspense and Concurrent Mode covers it

How deep it goes
Defines JSX and its preprocessing, then explicitly defers further exploration.
Examples
Uses a quiz interface with reusable TextToggle components for questions and answers.
What it assumes
Assumes JavaScript-oriented React development while presenting the HTML-like notation and preprocessing model directly.
What you can do after
Apply it via Babel to describe reusable React interfaces with component props.
How it connects
Connects JSX with React, JavaScript, components, props, and Babel.

Also explained in

Compare how 6 books explain JSX →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of React Hooks in Action: With Suspense and Concurrent Mode. The section links point to the parts of the book it draws on.