Loading lesson…
Level 1 · Apprentice0 XP
Cut the bugs that come from copying state into more state with useEffect.
Step 1 / 5
ProblemTwo pieces of state hold facts that depend on each other, and an effect keeps them in step. It renders once with the old value, then again with the new one. Forget one update and the UI lies.
← → step
Before this: Lists and keys
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Find a component with a useEffect that only calls setState based on props or other state. Delete the state and the effect, and compute the value during render.