Skip to main content

r/reactjs


Most React performance advice is stuck in 2023. Here's what actually matters now
Most React performance advice is stuck in 2023. Here's what actually matters now
Resource

Kept seeing the same advice everywhere: wrap things in useMemo, useCallback everything, React.memo all the things.

Then i profiled an app I'd "optimized" this way, the memoization overhead was costing more than the renders it was preventing

with the react compiler now auto-memoizing at build time, most manual useMemo/useCallback is becoming dead weight.

wrote up what actually fixes react performance in practice:

  1. state colocation: move state closer to where it's used. this one change beats every useMemo in your codebase. seriously.

  2. the children pattern: pass children from above so they don't re-render when parent state changes. zero memoization needed.

  3. useTransition: mark non-urgent updates as transitions. input stays responsive, heavy renders happen in background.

  4. useDeferredValue: same idea but for values from props you don't control. smarter than debouncing.

  5. code splitting: lazy() + Suspense for routes and heavy components. don't lazy-load a button though.

  6. profile before optimizing: react devtools profiler, chrome performance tab, core web vitals. if you haven't measured it, don't optimize it.

also covered 5 performance bugs i keep finding in production codebases:

  1. components defined inside other components (full remount every render, not re-render)

  2. useEffect chains causing cascade re-renders

  3. context providers sitting too high in the tree

  4. unstable keys (Math.random() as key is surprisingly common)

  5. object/array literals in JSX props breaking React.memo

the useEffect chain one is probably the most common. three effects that depend on each other = three render cycles for one user action.

https://www.sethi.io/blog/react-performance-from-sluggish-to-lightning

what's the worst react perf bug you've had to track down?


Why are people moving from Next.js to TanStack Start?
Why are people moving from Next.js to TanStack Start?

I’ve been seeing a lot of YouTube videos lately about developers moving from Next.js to TanStack Start. As someone still relatively new to the JS ecosystem, it’s hard for me to tell what’s real technical improvement versus YouTube hype/content monetization.

I’d love to hear from people who actually use these frameworks in production or have serious experience with them.

  • What problems with Next.js are pushing people away?

  • What does TanStack Start do better in practice?

  • Is this mainly a DX trend, performance thing, architecture preference, or just “new shiny tool” energy?

  • Would you recommend a beginner/indie developer learn TanStack Start today, or is Next.js still the safer/default choice?

Looking for honest opinions from experienced devs rather than influencer takes.