Mass-deleting class components in 40K-line React codebase

I mass-deleted class components from a 40K-line React codebase. Took me 3 weeks. Zero regrets. Here's what actually changed: → Bundle size dropped 12% → New devs onboarded in days, not weeks → Bug count fell off a cliff The biggest win wasn't performance though. It was readability. Class components hide logic behind constructors, lifecycle methods, and 'this' binding gymnastics. Functional components with hooks? You just... read top to bottom. Done. But here's what most "React best practices" posts won't tell you: None of this matters if you skip the boring stuff. I'm talking about: - ESLint configured properly (not just installed) - Actual test coverage (unit + integration, not just snapshots) - React.memo where it counts (not everywhere) - lazy() + Suspense for routes nobody visits on first load - TypeScript or at minimum prop-types The flashy patterns get all the LinkedIn love. Component composition, custom hooks, memoization strategies. But the teams shipping the fastest? They nail the fundamentals first. They lint religiously. They write tests before refactoring. They split bundles early so they're not scrambling at 50K users. Honestly, the best React code I've seen looks boring. Short functional components. Clear prop types. Styles extracted out of JSX. Arrow functions keeping things tight. No magic. Just discipline. What's the one React practice your team adopted that made the biggest difference? #reactjs #webdev #javascript #frontend

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories