Why this object is possibly null or undefined if it's in an else if?
Advertisements I’m using the below code in a component: Box.svelte: <script lang="ts"> type T = $$Generic; export let loading = false; export let error = false; export let value: T | null | undefined = undefined; </script> <div> {#if loading} Loading… {:else if error} Error… {:else if value} <slot {value} /> {/if} </div> Using it… Read More Why this object is possibly null or undefined if it's in an else if?