I have a basic if/else in the app to show either a preloader or a component.
{#if preloading}
<video />
{:else}
<svelte:component this={component} on:preload={preload}/>
{/if}
It starts with displaying the component correctly, when the preload flag is set, it shows the video, but it shows it over the svelte:component rather than replacing it.
I tried using {#key} to force a rerender by using a number as an id and incrementing it when preload is set, but the component is still there.
Any ideas?
question from:
https://stackoverflow.com/questions/65905277/svelte-conditional-component-rendering 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…