Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

InnerAppField.svelte

17 lines465 Bytes

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))}