Refactoring React
summary
Covers concrete refactors: remove props usage in constructors and compute derived values in render, rename event props to behaviors and normalize onChange across inputs, extract UX into a reusable hook (example useSmartness) instead of HOCs, add tiny React Testing Library tests that assert a login button is disabled by default and becomes enabled after typing, prefer React Context over cloneElement for propagating form disabled state and merge props/className carefully to avoid overrides.
AI-written summary · about
chapters (5)
- 0:00Start
- 8:16looking at a reusable component
- 17:15create a new scope
- 17:33create a function functional component
- 20:32convert this into a hook
related talks
45mReact refactoring, off the hook(s)!
35mAdvanced patterns in building React Components
12mReducing bugs in a React codebase
22mCrafting Pristine React: Best Practices for Maintainable Code
49mSupporting accessibility in React: the difficulties and niceties
31mReact Refactoring Patterns
34m90% Cleaner React
33mReact Advanced Patterns
