You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const createApp = (initialPage) => createInertiaApp({
page: initialPage,
resolve: async (name) => {
const component = await getComponent(routes[`./routes/${name}.svelte`]);
return {
default: component.default,
layout: await getLayout(initialPage, component) <-- Motivation here. Only have access to the very first page from first page load
}
},
setup({el, App, props}) {
// Called only when isSSR is false
new App({target: el, props})
},
});
I'm willing to submit the required PR, however this would be a breaking change unless it's passed as a second parameter
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
PR open: #1864
Hi,
I would like to have a way to get the current request
page
in theresolveComponent
callback.Some context
Internally, the router gets
setPage
called and this function calls ourresolveComponent
, however it limits the object to the component property only.It would be great if instead we could get the full
page
object in the resolveComponent function.Motivation
I would like to pass the layout to render from my backend using props. Exemple
I'm willing to submit the required PR, however this would be a breaking change unless it's passed as a second parameter
Beta Was this translation helpful? Give feedback.
All reactions