🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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)?

  1. A.Nothing until you refresh the page
  2. B.React stores the new value and re-renders the component
  3. C.The DOM is replaced by a blank page
  4. 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 →