Next.js & React

State

What It Is

Data that can change over time and causes the UI to update

Analogy

The current mood of your restaurant — busy, slow, sold out — and the sign you flip accordingly

Try It Out

State Management

Component State
const [count, setCount] = useState(0)
0

Click buttons to change state and trigger re-render

State initial