Loading lesson…
Level 1 · Apprentice0 XP
Caching, loading states, refetching and mutations without hand-written effects.
Step 1 / 6
ProblemEach screen has useEffect + fetch + useState for data, loading and error. Two screens load the same user twice. After saving, the list shows old data until reload.
← → step
Before this: Styling React apps
🛠️ 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.Replace hand-written useEffect fetching on two screens with TanStack Query. Add a mutation that invalidates the list and an optimistic toggle with rollback on error.