Skip to content

Commit e1bf42a

Browse files
committed
refactor(FormComponent): update Reset.svelte children
Refactor Reset.svelte to use the snippet block for children and remove the let:errors prop from the Form component. This improves code clarity and aligns with updated Svelte syntax.
1 parent 461cffc commit e1bf42a

File tree

1 file changed

+3
-1
lines changed
  • packages/svelte5/test-app/Pages/FormComponent/SubmitComplete

1 file changed

+3
-1
lines changed

packages/svelte5/test-app/Pages/FormComponent/SubmitComplete/Reset.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<div>
66
<h1>OnSubmitComplete Reset Test</h1>
77

8-
<Form method="post" let:errors onSubmitComplete={(props) => props.reset('name')}>
8+
<Form method="post" onSubmitComplete={(props) => props.reset('name')}>
9+
{#snippet children({ errors })}
910
<div>
1011
<input type="text" name="name" id="name" placeholder="Name" value="John Doe" />
1112
{#if errors.name}
@@ -23,5 +24,6 @@
2324
<div>
2425
<button type="submit">Submit</button>
2526
</div>
27+
{/snippet}
2628
</Form>
2729
</div>

0 commit comments

Comments
 (0)