Open ramiroaisen opened 5 years ago
I think this could be solved by a store inside the context of the layout. Currently this seams to be broken for SSR. See #917
The server-side context issue can be summarised as:
export n = 1;
const store = writable(0);
setContext(CTX_KEY, store);
$: $store = n;
// ...and then, in a child component...
const ctx = getContext(CTX_KEY);
<h1>{$ctx}</h1>
// => renders `<h1>0</h1>` (i.e. doesn't honour the change to store...until hydration)
Is your feature request related to a problem? Please describe. It would be nice if we could pass properties from pages to layouts
Describe the solution you'd like The solution would be very simple, just expose an
export let layoutProps
en every component (it could be done into the module context script of the componentHow important is this feature to you? I think this would be very usefull, instead of looking into the $page the child page can "tell" the layout how to behave