Open History to see the last commit
1<svelte:options runes />
2β
3<script lang="ts">
4 import { createForm } from '../src/index.js'
5β
6 const form = createForm(() => ({
7 defaultValues: {
8 test: ['a'] as string[],
9 },
10 }))
11</script>
12β
13<form.Field name="test" mode="array">
14 {#snippet children(field)}
15 <div data-testid="val">{JSON.stringify(field.state.value)}</div>
16 <button data-testid="push" type="button" onclick={() => field.pushValue('b')}>
17 push
18 </button>
19 {/snippet}
20</form.Field>