Option to have index.tsx
as the default behavior of routes instead of route.tsx
#5305
ferretwithaberet
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've seen quite some people struggle with the default nesting behavior of routes. It is also quite confusing that routes nest by default in my opinion.
I propose an option for the router plugin to consider routes as
index.tsx
by default. It could be nameddefaultRouteBehavior
and possible options would beroute
orindex
. The default value of this option would beroute
, for backwards compatibility, but it could be changed toindex
in a major version to make nesting explicit instead of implcit to avoid confusion.Setting this option as
index
will cause routes like:to be treated like
instead of the default behavior of
Beta Was this translation helpful? Give feedback.
All reactions