>

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

Introduction to Redux — State, Actions, and Reducers

Question 1 / 1

0:00
Core
Medium

A developer implements the RATE_COLOR case in the colors reducer:

case C.RATE_COLOR:
  const target = state.find(c => c.id === action.id)
  target.rating = action.rating
  return [...state]

In unit tests, the returned array correctly shows the updated rating. But connected React components never re-render when a color is rated. What is the root cause?