← Quiz: React Basics: all 10 questions
Quiz: React Basics · Question 7 of 10
What happens when you call the setter from useState, like setCount(count + 1)?
What happens when you call the setter from useState, like setCount(count + 1)?
- A.Nothing until you refresh the page
- B.React stores the new value and re-renders the component
- C.The DOM is replaced by a blank page
- D.The value changes but the screen never updates
Answer & explanation
Correct answer: React stores the new value and re-renders the component
State changes trigger a re-render with the new value.
Can you get the rest right without peeking?
Take the timed Quiz: React Basics quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →