State
The state is private and completely controlled by the component
import { usestate } from 'react';
function Counter() {
const [counter, setCounter] = useState(0)
return (
<>
<p>Counter: {counter}</p>
<button
onClick={() => setCounter(counter + 1)}
>
I want more
</button>
</>
)
}