React · Middle · Question 63 of 75

What does setCount(5) do if count is already 5?

Explanation

React compares the new state with Object.is. It may still render the component itself once before bailing out, but children and effects are skipped.

Further reading

Problem with a question

React · Middle · question 63

Test yourself

Take the React · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz