When to break up a component into multiple components
Loading article
Best Practices/Software Architecture
When to break up a component into multiple components
Kent C. Dodds·Jul 19, 2019·3 min read
By Kent C. Dodds
Web ComponentsRefactoringJavaScriptSoftware ArchitectureReactGitHub Actions
AI summary
This article challenges the impulse to prematurely break React applications into small components, arguing that single-component architectures are technically possible but introduce maintainability and performance issues. The author advocates for delaying component abstraction until specific pain points—such as performance degradation, testing difficulties, or collaboration bottlenecks—actually occur. The key insight is that premature abstraction is often more costly than code duplication.
Key points
React components should be split based on specific, identified problems rather than arbitrary size guidelines.
Premature abstraction often increases complexity and maintenance costs compared to the original code.
Large components can be managed effectively if they solve concrete issues like prop drilling or code reuse.
The cost of abstraction includes potential performance issues, harder testing, and increased difficulty in team collaboration.