Radu Catalin-Andrei’s Post

View profile for Radu Catalin-Andrei

🌍 Senior Full-Stack Engineer | B2B SaaS platforms with React, Next.js & Node.js | Headless CMS Integrations | Performance & Multi-Tenant Systems | Scalable Web Architectures | 7+ Years | B2B Contractor

Stop wrapping everything in useCallback. It's likely making your React app harder to maintain, not faster. I see this in code reviews constantly. A developer learns that useCallback "prevents re-renders" and suddenly every function in the codebase gets wrapped. But useCallback has a real cost: dependency comparison on every render, memory allocation for the memoized function, and added cognitive load when reading the code. It's only worth it in two situations: - You're passing a callback to a child wrapped in React.memo - The function is a dependency inside another hook's dep array If neither applies, you're paying the cost with zero benefit. The rule I follow: profile first, optimize second. React DevTools Profiler shows you exactly which components re-render and why. In 7 years of B2B SaaS work, most "performance" code I've removed didn't move any metric. It just made the codebase harder to read. Premature memoization is still premature optimization. What's the most common "optimization" you've seen in a codebase that actually made things worse? #React #TypeScript

To view or add a comment, sign in

Explore content categories