fix: use $effect instead of onMount

This commit is contained in:
madkarmaa 2025-04-05 12:17:21 +02:00
parent eb51ccfd88
commit bbb999a209

View File

@ -1,11 +1,11 @@
<script lang="ts">
import { theme } from '$lib/stores';
import { onMount, type Snippet } from 'svelte';
import type { Snippet } from 'svelte';
type Props = { children: Snippet };
let { children }: Props = $props();
onMount(() => {
$effect(() => {
document.documentElement.setAttribute('data-theme', $theme);
});
</script>