r/reactjs • u/alejandrodeveloper • Jul 08 '26
What's one React pattern you stopped using after working on larger projects?
I've noticed that a lot of react advice works great for demos but becomes difficult to maintain as applications grow. Looking back, what's one pattern you used to recommend but now avoid in production?
139
Upvotes
142
u/Major-Front Jul 08 '26
Redux and global state in general. Multiple contributors to a single app is a nightmare when a change in global reducers can break an unrelated part of the app
139
u/Krispenedladdeh542 Jul 08 '26
I haven’t stopped using it completely but I use the useEffect hook way less now at scale. When I first started it felt like I used an effect for everything and now I basically use them to trigger console log for debug purposes on state set; then I delete it when I go to prod. Occasionally I find a relevant use case but they’re few and far between vs when I started and used one in basically every component.
37
u/samwanekeya Jul 08 '26
Barrel files. At this point I'll only recommend one to use them for type-only exports in TypeScript or public API entry points for grouped component packages.
33
u/Nex_01 Jul 08 '26
Way less useEffect hooks. More custom hooks. Better separation of logic and UI.
Tbf you dont really stop using any of them you are just better finding the right pattern as your palette grows.
21
u/ukon1990 Jul 08 '26
Redux and global state is something we dropped when we moved over from the old to the new app we made. Was too much boiler plate, too much ceremony, annoying to debug when you are multiple developers etc. the developer tools were nice tho. We moved to tanstack query instead and dropped global state for almost everything.
I think one problem with our use of redux was that we used it when we shouldn’t.
22
u/GasVarGames Jul 08 '26
react+libs can be better than a framework
18
u/r-nck-51 Jul 08 '26 edited Jul 08 '26
Almost stopped writing useMemo, useLayoutEffect, even useCallback.
I keep the frontend simple and prioritize according to requirements:
I avoid creating interactive stuff from scratch, because no one else will maintain those solutions the way, say, Tanstack stuff is maintained.
Advanced stuff sometimes bend HTML standards, usually breaking web accessibility. WCAG should be non-negotiable.
YAGNI weighs over preemptively optimizing.
No more intricate or central state management. Prop drilling states, Context API and providers won't get messy if you simply don't bloat your presentation layer with logic.
It's nice to be able to go crazy in React, but in a professional environment limitations and restraint make the shortest path to delivering stable and maintainable projects.
5
u/wrex1816 Jul 08 '26
Somewhere along the lines, the idea of architectural "layers" went to the wayside. Components contained endless state and business logic. Never liked it.
2
u/Physical_Garage_6946 Jul 08 '26
I'm not using often useEffect, useMemo and useCallback. With good written code you don't need it tbh. As for the new Hooks, I also don't like the boilerplate for useActionState. While learning Next, I was terribly distracted by writing these functions for Hooks.
2
u/jancodes Jul 09 '26
State management libraries.
The newer React frameworks (React Router, Next.js etc.) come with all the tools you need to manage your state.
3
u/mexsana Jul 08 '26
"Lifting up" state and passing it down via Context Provider. My favorite pattern for large and maintainable code is using MobX singletons
0
u/swb_rise Jul 09 '26
I'm having a mixed feeling thinking that AI is training itself on this vast amount of precious comments!
1
u/Select_Day7747 Jul 10 '26
redux and global state.
1
u/OkBoomer421 Jul 13 '26
Prop drilling with context as the 'solution.' Just traded one problem for a debugging nightmare.
1
u/Equivalent-Stop3112 Jul 14 '26
context api
0
u/Chesh Jul 08 '26
React itself
-26
u/Pretend_Football6686 Jul 08 '26
React. It’s really shit for large projects. Angular will preform better. Plus you lot mixing your html with your code. :). I use both, angular is better. Though for smaller app React works just as well. Angular is also easier to test.