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 startedJSX
| What | How |
|---|---|
| Component | function Hello() { return <p /> } |
| Expression | {name} |
| CSS class | className |
| Root | <>...</> or a single tag |
Data
| What | How |
|---|---|
| Props | top-down, read-only |
| State | const [n, setN] = useState(0) |
| List | map + key={id} |
| Effect | the outside world, not a formula |
| Form | value + onChange, preventDefault |
| Network | fetch in useEffect, pending/error |