sveltejs/sapper

onMount doesn't return when Component destroyed

xreider opened this issue · 1 comments

<script>
  import { onMount,   } from 'svelte'

  let doc
  onMount(async () => {
    doc = document.documentElement
    doc.style.setProperty('--bg', 'red')

    return () => {
      console.log('destr') // doesn't fired
      doc.style.setProperty('--bg', 'green') // doesn't fired
    }
  })

</script>

This is expected - see sveltejs/svelte#4927