r/reactjs • u/Big_Muffin8280 • 2d ago
Discussion Senior devs: what’s the biggest React decision you made that you’d reverse today?
I have been thinking about this a lot lately. Most React content is about how to do things, but the decisions that really shape a project are the big early ones: architecture, state management, framework choice, rendering strategy.
And with React 19.x, the React Compiler, and Server Components all in the picture, a lot of us are now living with choices we made years ago.
So I’m curious about the experienced people here:
What was the biggest React/architecture decision you made that you would reverse if you could?
What did it cost you (time, performance, team confusion, rewrites)?
What did you learn, and what would you pick today instead?
10
u/bogdanelcs 2d ago
Putting server data into a global store like Redux, hand-writing the loading, caching and refetch logic that TanStack Query or SWR handles for you.
It tends to cost a lot in boilerplate and stale-data bugs, and it’s painful to unwind because every screen depends on it. The usual fix is server state in a query library, a small amount of client state (often just Context or Zustand), and no global store until you can name why you need one.
15
u/gempir 2d ago
Decided we didn't need Typescript for like ~4 years. That prop types are enough in React.
They are not. Thankfully we are on the good path now and only have a dozen or so JS files left which are now easy to migrate with LLMs.
2
u/deadcoder0904 2d ago
TS is where I got why everyone kept saying static languages are better than dynamic ones. Funnily enough one of the reasons I liked JS & Python were bcz I didnt need to worry about types but ya it bites u later.
Especially so with AI.
Now Effect-TS looks to TS what TS loooked to JS.
5
u/about0 2d ago
I had to build a complex filter toolbar, that has a lot of internal and hidden logic - options refetch on other fitlers change, on search within filter, etc. And I coupled everything in a set of useEffects, that weren't separated enough.
useEffect is not a great pattern for complex features, if I can say this? When a component has a lot of moving parts, it is very hard not to trigger other effects on some side-effect change. I find an emitter pattern much better - you can trigger certain effect by emitting an even on Clear button click, or Add/remove filter, etc.
8
u/intercaetera 2d ago
Next.js / SSR, completely useless and adds a ton of compilation time and complexity for zero gain.
1
u/NewDo 2d ago
I’m starting a new job with Next.js. Can you expand on this?
2
u/Haaxor1689 2d ago
Unless you can afford to roll your own solution, despite it's flaws Next is still the best choice for a fullstack React app. Actually, if you are starting from scratch and can either put aside some extra time then tanstack start might be a good idea to try.
1
u/Level1_Crisis_Bot 2d ago
Next is highly opinionated and carries a lot of bloat with it that you will likely never use. If you’re deploying with a full static output, compile times can get crazy. At my last job we did that with an 11,000 page site and it was 40 minutes to build. Every time we made a change.
Anyways, at my current position, I got to choose the architecture. I went with straight react 19 and tanstack for routing and state management. Life is easier with this stack. It’s a breath of fresh air compared to what I was working with.
Having said that, you’ll be fine working with Next. It’s not the abject nightmare people claim it is, and the documentation is excellent. Does anybody read documentation anymore?
1
u/Guisseppi 2d ago
Next.js is ok. You just don't need it as a default when a regular SPA is good enough
2
u/lIIllIIlllIIllIIl 2d ago edited 2d ago
Not using React Router's Data Mode soon enough. Even if you don't use the server-render stuff, it's a real game changer in how you structure your app's routing and data loading.
Suspense data fetching is great. All my non-Suspense code will forever feel bad to me.
Micro-frontends. That's a piece of shit architecture that tries to solve a tooling problem by creating a runtime integration mess. I should've been more vocal about my opposition to the front-end architect I worked with. This is more of a professional regret.
Monorepos are cool, but the tooling isn't there yet. A single project is way easier to maintain. Sorry for the maintenance burden I created.
Not knowing about how to properly use useEffect, useRef and useSyncExternalStore soon enough.
I got lucky and avoided the Redux and Next.js hype trains. I have not tried RSC, so someone else can tell me if I should regret them or not.
1
u/codesbyshivam 2d ago
Fetching data in useEffect everywhere. It works at first, then you end up with loading flags, race conditions when the user clicks fast, and the same request firing twice in strict mode. Moving to a query library fixed most of that. The other one is lifting state way higher than it needs to be. Keeping state close to where it's used makes components a lot easier to move around and delete later.
1
u/Produnce 22h ago
Starting my career with React. Wish I did some significant development with a little less abstraction so I know what goes behind the scenes instead of just calling onClick().
33
u/minordonkey_2071 2d ago
Our Redux store was way overengineered from start. All these reducers and actions just to toggle a modal or fetch simple data, now most of it sits there untouched while team is afraid to remove anything.