Is there any way to pass parameters to a persistent layout? #862
Unanswered
maxonfjvipon
asked this question in
Help (React)
Replies: 1 comment 3 replies
-
I have used this approach to pass props from children to layout /* eslint-disable no-unused-vars */
function Users({ auth }) {
return (
<>
<Content>
Users view
</Content>
</>
)
}
Users.layout = page => {
return (
<DashboardLayout auth={page.props.auth}>
{page}
</DashboardLayout>
)
}
export default Users It is not the same you need but I think that with this approach you can figure out how to do what you need. |
Beta Was this translation helpful? Give feedback.
3 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there.
I recently started work with Inertia and I like it, but there's a problem, that makes me invent the wheel...
It's about React. Here's persistent layout, that I use:
And here's Projects/Show page:
I want
title
ofAuthenticated
layout component to beproject.name
that I got fromusePage
hookIs there any way to take some props from component and pass them to layout without crutches?
Beta Was this translation helpful? Give feedback.
All reactions