Open History to see the last commit
1<!-- Take "form" as an prop, pass it to context, and render children -->
2<script lang="ts">
3 import { setContext, type Snippet } from 'svelte'
4 import { fieldContextKey } from './context-keys.js'
5β
6 interface Props {
7 field: any
8 fieldComponents: any
9 children: Snippet<[any]>
10 }
11β
12 const { children, field, fieldComponents }: Props = $props()
13β
14 setContext(fieldContextKey, field)
15</script>
16β
17{@render children?.(Object.assign(field, fieldComponents))}