Queueing a series of state updates Flashcards
1
Q
What happens when you set state in React?
A
It does not change the variable in the existing render, but requests a new render.
2
Q
What is batching in React?
A
React processes state updates after event handlers have finished running.
3
Q
How can you update some state multiple times in one event in React?
A
Use the setNumber(n => n + 1) updater function.