Persistent layouts and shared data #2372
Closed
andresgutgon
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
Maybe for this case, having a dashboard is not critical to have the URLs of the links SSR, but for something more SEO focus is critical. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Inertia gives you the current URL with |
Beta Was this translation helpful? Give feedback.
4 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.
-
What?
Maybe this is possible somehow but I don't see how. Let's say I have this page
Docs:
In this app I have a sidebar that has the main links of the app.
The page is SSR
This is the key part. I'm using a similar package to wayfinder to generate the URLs of my Phoenix app
This version of Wayfinder can tell if the current page (the one in the URL) is the one in one of the links in the sidebar. Would be something like this
home.url({ currentPath })
returns{ path: string; isCurrent: true }
and with that I decide how to style the link.The problem I have is that I need to pass
currentPath
on the SSR page.Before I had the sidebar in
MainLayout
but I don't see a way of passingprops
to persistent layouts. Is there one?What I did instead is move it to an
<AppWrapper />
but that defeats the goal of persistent layoutsBeta Was this translation helpful? Give feedback.
All reactions