arrow_backBACK TO DRILLS
Blue Beltstate-basicsPREMIUM
Mirroring props into state
A component initializes state with const [color] = useState(props.color). Later, the parent passes a different color prop, but the UI still shows the old one. Why?
A component initializes state with const [color] = useState(props.color). Later, the parent passes a different color prop, but the UI still shows the old one. Why?