React
UI = a function of state. That is the whole framework.
▶ the lesson · ~35s · narrated · tap for sound
the intro
React is a JavaScript library for building user interfaces out of small, reusable pieces called components. You describe what the screen should look like for a given state, and React figures out how to update the page when that state changes. Once it clicks, you stop fighting the DOM forever.
the sample
a real component, in full
function Counter() {
const [n, setN] = useState(0)
return (
<button onClick={() => setN(n + 1)}>
Clicked {n} times
</button>
)
}fun fact ✦
React was born at Facebook in 2011 to tame their own ad-code chaos. Now it runs a huge chunk of the internet.
the docs
quick hits about React
15-second answers · interviews, tips, trivia & hidden gems
Props or state?
Why does your useEffect loop forever?
What does the virtual DOM do?
Two components need the same data?
Forms the React way?
Reuse logic between components?
Why not use the index as key?
One component crashes everything?
Still writing useMemo everywhere?
Forms in React 19?
React had another name?