← React Intermediate Questions - Set 8 Q72

What is the purpose of `useState` in React?

React Intermediate Questions - Set 8

Example

const [step, setStep] = useState(1);
setStep(s => s + 1);

What to notice

← Back to the question list