I am using SvelteJs with svelte-spa-router.
I have my cases where I do
<script>
import Component1 from './Component1.svelte'
import Component2 from './Component2.svelte'
</script>
{#if condition}
<Component1 {...props1} />
{:else}
<Component2 {...props2} />
{/if}
Is there a better way I can do this? Can I dynamically import and render components only when condition is met?