Loading lesson…
Level 1 · Apprentice0 XP
Stop adding boolean props. Pass children and let callers compose.
Step 1 / 5
ProblemCard started simple. Now it has showHeader, showFooter, headerIcon, footerAlign, compact and isDanger. Every new need adds a prop and a branch, and nobody dares touch it.
← → step
Before this: Custom hooks
🛠️ 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.Take a component with three or more boolean props (showX, hideY, isZ). Rewrite it so the caller passes children or named slots instead, and delete the booleans.