Secrets of building robust UI components at scale
summary
Argues that robust React UIs come from concrete choices: enforce linters/formatters and auto-sorting imports, use Storybook and component tests (Cypress) to exercise every state, adopt TypeScript strict mode and zod for runtime parsing, prefer string-literal union props over booleans, co-locate logic into hooks, and keep APIs minimal. Recommends atomic design as a mental model, using compound components and polymorphic components where appropriate, and relying on generics and overloads to encode precise prop contracts.
AI-written summary · about
chapters (19)
- 0:00Introduction and welcome
- 1:50About the speaker
- 3:14Defining robust UI components
- 4:17Tooling for robust UIs
- 8:28Building components in isolation
- 9:31Automated component testing
- 10:15Theming and design tokens
- 12:01Atomic design methodology
- 15:18Code organization tips
- 16:24React component prop patterns
- 21:40Exposing component types safely
- 24:33Reusable UI component structure
- 25:15Compound and polymorphic components
- 27:24Generics in React components
- 28:31Overload function components
- 29:12Interfaces vs types in TypeScript
- 31:40TypeScript best practices
- 34:10Strict TypeScript configuration
- 35:15Key takeaways and conclusion
