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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is batching in React?

A

React processes state updates after event handlers have finished running.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can you update some state multiple times in one event in React?

A

Use the setNumber(n => n + 1) updater function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly