woutdp / live_svelte

Svelte inside Phoenix LiveView with seamless end-to-end reactivity
https://hexdocs.pm/live_svelte
MIT License
1.2k stars 46 forks source link

Set HEAD correctly #4

Closed woutdp closed 1 year ago

woutdp commented 1 year ago

For the SSR, we sometimes return a head depending if the Svelte component has something like:

<svelte:head>
  <title>Some title</title>
</svelte:head>

Ideally we include this in the root head somehow on first page render, I haven't found a way to do this from the live_component.

Currently this just does not work and we don't include the head, we only include the styling.

woutdp commented 1 year ago

Sort of fixed, for now we set the head script in the body, which seems to work but it's not ideal as on first page load it might take some time before it's loaded in. But it will do for now.