← React Intermediate Questions - Set 9 Q86

How do you update the state of a functional component in React?

React Intermediate Questions - Set 9

Example

setCount(c => c + 1);   // functional update reads the latest value

What to notice

← Back to the question list