Skip to content

What's the difference between hybrid folder routes and the folder+ naming convention? #33

Answered by kiliman
brandonpittman asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, sorry. I need to update the docs.

There are technically only two types:

  • flat-files
  • flat-folders

The route name uses . to separate the URL segments. So a.b.c is the same as /a/b/c.

With flat-files, your route is simply a filename (a.b.c.tsx). With flat-folders, the route is the folder name, and your route file is a file (a.b.c/_index.tsx). This allows you to colocate supporting files (a.b.c/component.tsx).

The problem with both is that the entire route had to be a single name. This made long routes cumbersome to use.

Hybrid routes simply allow you to break up your route names using / to create folders.

So instead of a.b.c/_index.tsx, you can have a top-level folder a and still use …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@brandonpittman
Comment options

Answer selected by brandonpittman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants