index.tsx
usestate.ts
hydration.md
event-loop.js

git log -- hooks --the-why

hooks are just
state with manners.

closures, rules of hooks, and why your setState feels delayed — the commit history of function components growing a brain.

open the commits →
usestate.tscommit a3f9c21
12class Counter extends React.Component {
13- this.state = { count: 0 }
14- this.setState({ count: count + 1 })
13+ const [count, setCount] = useState(0)
14+ setCount(count + 1)
15}
why: class state meant logic glued to a lifecycle you didn't pick. hooks let state live in a function — reusable without a HOCs museum.

hooks commits

1 dissected

← all topics