React
Hooks
Hooks let function components use state and other React features without writing
a class. The most common one is useState:
function Counter() {
const [count, setCount] = useState(0);
return <button onClick={() => setCount(count + 1)}>{count}</button>;
}
Hooks must always be called in the same order on every render — never inside conditionals, loops, or nested functions.