r/reactjs • u/alvivan_ • Aug 18 '26
Needs Help What router are you using
Currently I have to create a new project, my first option is react router (declarative mode). My entire project will live behind the login page
what are you using?
- RR framework mode
- RR data mode
- RR declarative mode
- tanstack router
- wouter
25
Upvotes
57
u/D3kalog Aug 18 '26
tanstack, file based, no regretz
2
u/gioacostax Aug 23 '26
Tanstack router a pesar de las ventajas del tipado me recuerda a ver pequeños proyectos usando redux para manejar un estado que solo lo usa un componente….
20
u/ZwillingsFreunde Aug 18 '26
Tanstack it is. By far the best out there if you want strong typing
15
u/Innowise_ Aug 18 '26
For an app that mostly sits behind login, we'd keep the router boring unless routing itself is doing a lot of work. React Router is perfectly fine for straightforward protected routes. TanStack starts getting more interesting when you actually benefit from typed params/search state and more complex route-level data flows. Wouldn't switch just because it's the popular answer here.
8
u/TaricIsMyBF Aug 18 '26
React router data mode, as im used to it and works fine for all of my needs
4
u/90sRehem Aug 18 '26
Tanstack, code based.
3
u/Outrageous-Chip-3961 Aug 19 '26
tanstack router by far
2
u/neon_alchemy_wisp Aug 19 '26
react Router in data mode. The loader based auth pattern handles your protected route requirement cleanly without the boilerplate you get with declarative guards.
2
u/HunterCharacter2941 Aug 19 '26
If your whole app is behind login, your routing problem is pretty simple, so any of these will work fine and you're probably overthinking the choice
2
u/PasswordSuperSecured Aug 20 '26
Tanstack all the way sir
3
u/pimpaa Aug 18 '26
RR data mode
3
u/Opposite_Cancel_8404 Aug 18 '26
React router declarative mode. Tanstack looks sweet and I was considering switching but I don't think there's much benefit for the amount of work the migration would be. Next time I get a chance I will check it out!
3
u/belousovnikita92 Aug 18 '26
I’m not going to touch react router again after doing 2 (3?) major updates
2
u/repeating_bears Aug 19 '26
Recently migrated from react router v7 to tanstack start
I quite liked RR but development on it is basically dead. The creators have moved on to Remix (completely new framework, they just reused the name). I've had people from the RR team reply on Reddit before saying it's not dead, but I've raised multiple issues that just get ignored.
In terms of type safety, I don't think there's actually much in it. RR is 95% of the way there, and the 5% I didn't care about
I'm still getting to grips with tanstack's model, but I would say RR was slightly simpler and easier to learn
I wouldn't recommend a greenfield project to pick RR
1
u/WearyCarrot Aug 18 '26
Ubiquiti dream router 7
Sorry 🥲 I actually thought I was in a networking sub lol
1
u/franciscopresencia Aug 18 '26
I built my own tiny router, Crossroad:
https://crossroad.page/
The URL is your data store, so you can do cool things having useQuery behave similarly to useState, while changing the query parameter specified:
1
u/enigmachine10 Aug 19 '26
since you'd be using declarative mode, wouter is enough without the bloat.
1
u/varisophy Aug 19 '26
Astro! It's file based and has done wonderfully for us.
0
u/EquivalentBear1513 Aug 18 '26
Nextjs
-1
u/Lumpy_Pin_4679 Aug 18 '26
Remix yesterday. RR today. Tomorrow?
RR is never the answer. Tanstack all the way!
0
u/bigorangemachine Aug 18 '26
Memory Router... because we're watching you