One page

React cheat sheet

What to keep at hand. If a line is not clear, go back to the matching lesson in the course.

Open the course: React: getting started

JSX

WhatHow
Componentfunction Hello() { return <p /> }
Expression{name}
CSS classclassName
Root<>...</> or a single tag

Data

WhatHow
Propstop-down, read-only
Stateconst [n, setN] = useState(0)
Listmap + key={id}
Effectthe outside world, not a formula
Formvalue + onChange, preventDefault
Networkfetch in useEffect, pending/error