r/reactjs • • Sep 14 '25
Discussion File-based routing vs code-based routing in TanStack router, which one do you use and why?
[deleted] — view deleted post
35
Upvotes
r/reactjs • • Sep 14 '25
[deleted] — view deleted post
View all comments
2
u/yksvaan Sep 14 '25
Code based definitely. It's much nicer to have all routes in one place. Well not literally one file, usually every module handles registering their routes, services etc. but you can have a clean bootstrap process. That also works as an entry point to get an idea what the app actually does and possible routes.
Especially from security audit perspective file based routing is annoying