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
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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