>

CODEMASTERYLAB

IDE PLATFORM
CoursesCommunity BlogsKnowledge GraphQuizzesInterview Prep

Sign in to track progress & earn XP

Sign In Create Account
>
Code Mastery Lab

Code Mastery Lab

Sign In

The Component Tree — State, Data Flow, and the Color Organizer

Question 1 / 1

0:00
Core
Medium

In the Color Organizer, a developer adds a 'Clear All Ratings' button to the App component. When clicked, it should reset every color's rating to 0. They write:

clearAllRatings() {
  this.state.colors.forEach(color => {
    color.rating = 0
  })
  this.setState({ colors: this.state.colors })
}

The button click triggers no visible update. What are the two bugs?