onMount doesn't return when Component destroyed
xreider opened this issue · 1 comments
xreider commented
<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>
Conduitry commented
This is expected - see sveltejs/svelte#4927