Skip to content

Commit

Permalink
feat: Use svelte 5 syntax in svelte 5 template
Browse files Browse the repository at this point in the history
  • Loading branch information
ottomated committed Jun 18, 2024
1 parent f9cb09b commit 32315d8
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script lang="ts">
import type { Snippet } from 'svelte';
const {
title,
learnMore,
children,
}: {
title: string;
learnMore: string;
children: Snippet;
} = $props();
</script>

<section class="flex w-1/3 flex-col gap-2 rounded-lg bg-zinc-800 p-4 shadow-lg">
<h1 class="mb-2 text-xl font-bold">{title}</h1>
{@render children()}
<a
href={learnMore}
target="_blank"
rel="noreferrer"
class="mt-auto pt-3 text-right text-blue-400 hover:underline"
>
Learn more
</a>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import '../app.css';
const { children } = $props();
</script>

{@render children()}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script lang="ts">
import '../app.css';
import { QueryClientProvider } from '@tanstack/svelte-query';
import { trpc } from '$lib/trpc';
const { data, children } = $props();
const queryClient = trpc.hydrateFromServer(data.trpc);
</script>

<QueryClientProvider client={queryClient}>
{@render children()}
</QueryClientProvider>

0 comments on commit 32315d8

Please sign in to comment.