Modern frameworks sell us on file-based routing with a very tempting pitch: just create a file, and your URL is ready to go. It feels practical, as if navigation is solved simply by organizing folders. But the reality is rarely that simple. Every framework has its own set of rules for managing folder structures, and these nuances aren't always clearly documented. Problems start cropping up the moment our desired URL structure stops syncing up with the actual files on our disk.
Looking at how current frameworks operate, the approaches are night and day. Next.js, with its App Router, is powerful but incredibly dense. Concepts like route groups or intercepting routes are cool, but they can easily backfire if your team isn't already thinking in that specific pattern.
On the other hand, Remix or React Router feels more honest. The filenames
reflect the URL directly, for example, invoices.$id.tsx. This just makes more
sense if you want full control without having to guess what the browser URL is
actually going to be. Then there's Astro, which is very straightforward for
content-heavy sites, though it might fall short for complex apps requiring heavy
nested layouts.
One thing that often gets overlooked is UI ownership at every segment. The true essence of file-based routing is the ability to break the UI into small pieces that own their own loading states or error boundaries. If we fail to define these boundaries correctly, we just end up with one giant layout that constantly re-fetches data every time we navigate. That isn't efficient nested routing; it’s just a standard page transition wrapped in a complicated folder structure.
Not everything should strictly follow the folder hierarchy, either. Sometimes, we need escape hatches for when a client requests a messy URL that defies our folder logic. This is where a framework's true flexibility is tested.
Choosing a router isn't about finding the most sophisticated tool; it's about how clearly the system "teaches" the URLs to us. If you're building an app with many layers of independent navigation, you have to be ready to learn their specific conventions. If you aren't, you'll just end up confused as the project grows.
In the end, there is no perfect approach. We just have to decide which type of complexity we are actually willing to deal with.