routeId
should be based on route path instead of file name.
#14147
adnanalbeda
started this conversation in
Proposals
Replies: 1 comment
-
Let's say you have: layout(layoutFile, [
route("home", homeFile, [
index(indexFile)
])
]) All of that becomes What's the route id of each layout route, the home route and the index route? The file is more unique than the path as many routes can become the same path, and some routes may not even have a path (layouts and index) |
Beta Was this translation helpful? Give feedback.
0 replies
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'm trying React-Router Framework, and I tried to add my first route:
Then I ran
pnpm dev
and got hit by error:So I discovered that route Ids are file based, instead of path based.
Technically, no one would use same file in more than one route, but it should be possible.
What's more unlikely is overriding route path or duplicating them.
So I tried this code:
It had no issues running it, picked the first
/home
routehome2
, and doesn't override it.So I guess it makes more sense to pick routeId from the route path instead of file based to avoid duplicating route path.
Beta Was this translation helpful? Give feedback.
All reactions