mirror of https://github.com/sveltejs/svelte
parent
54ba176d2c
commit
669f6b45a3
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: prevent hydration error on async `{@html ...}`
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
import { tick } from 'svelte';
|
||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
mode: ['hydrate'],
|
||||||
|
async test({ assert, target }) {
|
||||||
|
await tick();
|
||||||
|
assert.htmlEqual(target.innerHTML, `<div><div><p>first test</p></div> other test</div>`);
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
<script>
|
||||||
|
function firstTest() {
|
||||||
|
return Promise.resolve('<p>first test</p>');
|
||||||
|
}
|
||||||
|
|
||||||
|
function otherTest() {
|
||||||
|
return Promise.resolve('other test');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div>{@html await firstTest()}</div>
|
||||||
|
{await otherTest()}
|
||||||
|
</div>
|
||||||
Loading…
Reference in new issue