From 9fc2ab8cc848739a21bfa3f754e9bec4926dc034 Mon Sep 17 00:00:00 2001
From: Jacob Jenkins <jacob_jenkins@live.com>
Date: Thu, 14 Nov 2024 15:31:51 +0000
Subject: Update to svelte 5 (#12364)

Co-authored-by: bluwy <bjornlu.dev@gmail.com>
---
 examples/framework-svelte/src/components/Counter.svelte | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

(limited to 'examples/framework-svelte/src/components/Counter.svelte')

diff --git a/examples/framework-svelte/src/components/Counter.svelte b/examples/framework-svelte/src/components/Counter.svelte
index 1353736aa..a11538645 100644
--- a/examples/framework-svelte/src/components/Counter.svelte
+++ b/examples/framework-svelte/src/components/Counter.svelte
@@ -1,5 +1,12 @@
 <script lang="ts">
-	let count = 0;
+	import type { Snippet } from 'svelte';
+
+	interface Props {
+		children?: Snippet
+	}
+
+	let { children }: Props = $props();
+	let count = $state(0);
 
 	function add() {
 		count += 1;
@@ -11,12 +18,12 @@
 </script>
 
 <div class="counter">
-	<button on:click={subtract}>-</button>
+	<button onclick={subtract}>-</button>
 	<pre>{count}</pre>
-	<button on:click={add}>+</button>
+	<button onclick={add}>+</button>
 </div>
 <div class="message">
-	<slot />
+	{@render children?.()}
 </div>
 
 <style>
-- 
cgit v1.2.3

