Created
December 16, 2025 22:38
-
-
Save daaniam/e44d02d5de01a98705da6f4a0d7e23f8 to your computer and use it in GitHub Desktop.
TanStack Form Error Subscription
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form.Subscribe selector={(state) => state.fieldMeta}> | |
| {#snippet children(fieldMeta)} | |
| {#each Object.entries(fieldMeta) as [fieldName, meta]} | |
| {#if meta.errors?.length} | |
| {#each meta.errors as error} | |
| <p class="text-destructive text-sm">{fieldName}: {error?.message ?? error}</p> | |
| {/each} | |
| {/if} | |
| {/each} | |
| {/snippet} | |
| </form.Subscribe> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment