Stack Overflow Blog · 5 min readFrontend frameworks
Don’t Build the Reusable Component Yet
Premature abstraction in UI code can create coordination overhead and fragile components. Duplicate implementations are cheaper until a pattern repeats three times for the same reason, after which safe abstractions can be extracted.
- Copy‑paste until the same logic appears three times with a single change reason before refactoring
- Avoid flags that encode mode or variant in props; they indicate over‑abstracted components
- Extract only stable primitives, design tokens, and standard‑driven utilities as shared code