Replies: 1 comment 1 reply
-
Have you been able to find a solution for that? |
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
-
Hi everyone!
I'm looking to add an optional language param that's available in all my routes. If the user isn't logged in, the language would be the param language. However, if the user is logged in, the page language would be the language from their user settings. I'm hoping for the following URL structure:
/$lang/about
when not logged in/about
when logged inI saw another discussion (#146) about optional params where the conclusion was to create two routes, one with the param and one without. But that wouldn't be very clean for this use case since I'd have to duplicate all routes in my app.
I had an idea to put all the routes in a separate array and pass them as children for both the "languageWrapperRoute" and the root route:
But that doesn't work because all routes need to have
getParentRoute
which would be different depending on if the route is in thelanguageWrapperRoute
children, onrootRoute
children.Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions