State with useState
State allows components to remember information and re-render when it changes.
jsx import { useState } from 'react';
function Counter() { const [count, setCount] = useState(0); return ( <button onClick={() => setCount(count + 1)}> Count: {count} ); }