
Things I Stopped Writing in React (And What Replaced Them)
Over the past year, I noticed I was deleting more code than I was writing. Not because I was cleaning up old mistakes, but because React had quietly started doing things I used to do myself. At first, I thought it was just me getting more comfortable with the codebase, but then I realized React itself had changed, and a lot of what I was writing by hand had a simpler, built-in way of doing it now. These are five of those patterns, which I was writing before, and what replaced them after React 19. 1. Stopped Writing useMemo and useCallback For a long time, these two were almost a reflex. Open a component, see a function being passed as a prop, wrap it in useCallback . See a filtered list being computed, wrap it in useMemo . It was just what you did. Not always because you had profiled something and found a problem, but because it felt responsible. The React Compiler changed that. It runs at build time, reads your component, and handles the memoization automatically. You write the compon
Continue reading on Dev.to
Opens in a new tab



