What's the difference between hybrid folder routes and the folder+
naming convention?
#33
-
The docs don't make this very clear. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yeah, sorry. I need to update the docs. There are technically only two types:
The route name uses With 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 So instead of The Anyway, flat routes is smart enough to know whether you're using Hope this clears things up. |
Beta Was this translation helpful? Give feedback.
Yeah, sorry. I need to update the docs.
There are technically only two types:
The route name uses
.
to separate the URL segments. Soa.b.c
is the same as/a/b/c
.With
flat-files
, your route is simply a filename (a.b.c.tsx
). Withflat-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 foldera
and still use …