Svelte: is there a way to modify property in layout file from a slot component or from a parent layout?

Viewed 41

In routes/home/__layout.svelte, there is a variable:

let activeId;

Is it possible to modify the activeId from:

  1. routes/home/content.svelte, which will use the above layout.
  2. routes/__layout.svelte, which is a parent layout of the above layout.
1 Answers

I would probably just use a store that is made available through a context that is set in the root layout.

Related