example component with atcute xrpc handler passing via props

This commit is contained in:
Badtz 2025-03-27 23:27:29 -07:00
parent 72f418058f
commit 37e68e86bf
3 changed files with 10 additions and 2 deletions

View file

@ -1,2 +1,7 @@
<h1>Home Page</h1>
<script>
import List from "$lib/components/list.svelte";
</script>
<h1>Home Page</h1>
<List did="test" />

View file

@ -1,4 +1,5 @@
<script lang="ts">
import List from '$lib/components/list.svelte';
import type { PageProps } from './$types';
let { data }: PageProps = $props();
@ -8,5 +9,6 @@
<h1>{data.userData.handle}</h1>
<h2>{data.userData.did}</h2>
<List did={data.userData.did} rpc={data.rpc}/>

View file

@ -13,6 +13,7 @@ export const load: PageLoad = async ({ parent, params }) => {
userData: {
handle: params.handle,
did: userData.did
}
},
rpc
};
};