mirror of https://github.com/sveltejs/svelte
fix: ensure onMount correctly fires when new expressions are used (#14049)
* fix: ensure onMount correctly fires when used externally * fix root context * fix root context * revert * alternative fixpull/14056/head
parent
cdec39afac
commit
4a5a0b15d9
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: ensure onMount correctly fires when new expressions are used
|
@ -0,0 +1,7 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
async test({ assert, logs }) {
|
||||||
|
assert.deepEqual(logs, ['mounted']);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,13 @@
|
|||||||
|
<script module>
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
|
class MyClass {
|
||||||
|
constructor() {
|
||||||
|
onMount(() => console.log('mounted'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
new MyClass();
|
||||||
|
</script>
|
Loading…
Reference in new issue