File-based routes: share layout and preserve URL at dynamic path segment #13649
Unanswered
ivan-kleshnin
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I created an alternate FS routing package that might solve that issue, it uses Next naming convention though: https://github.com/pizzajsdev/pizzajs/tree/main/packages/app-router-fs |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I've read https://reactrouter.com/how-to/file-route-conventions#nested-layouts-without-nested-urls
It seems not possible to share layout while preserving URL for dynamic (
$variable
) segments.Try-1
Now, suppose we want 404 on
/en
and/de
, and 200 on/en/contacts
and/de/contacts
.Try-2
Try-3
Try-4
Try-5 (works)
Besides some verbosity for a common task, there's nothing too bad about the solution. Still, I wonder whether I've missed a better/more canonical way 🤔
Beta Was this translation helpful? Give feedback.
All reactions