Fix more TS errors in strict mode

This commit is contained in:
Ryan Gossiaux
2021-12-15 14:49:19 -08:00
parent 5b36ce9404
commit da6d2c3be6
9 changed files with 94 additions and 66 deletions

View File

@@ -114,16 +114,16 @@
import TransitionChild from "./TransitionChild.svelte";
import type { useId } from "$lib/hooks/use-id";
export let show: boolean = null;
export let show: boolean | undefined = undefined;
export let unmount = true;
export let appear = false;
let openClosedState: Writable<State> | undefined = getContext("OpenClosed");
function computeShow(
show: boolean,
show: boolean | undefined,
openClosedState: State | undefined
): boolean {
): boolean | undefined {
if (show === null && openClosedState !== undefined) {
return match(openClosedState, {
[State.Open]: true,
@@ -161,7 +161,7 @@
let initial = true;
let transitionBag: Writable<TransitionContextValues> = writable();
$: transitionBag.set({
show: shouldShow,
show: !!shouldShow,
appear: appear || !initial,
});