[v2] Make schema issues configurable for form-level report

Aperta
#2,402 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript

Direzione di ricerca

Look at the root schema validation logic in the TanStack Form v2 codebase, likely in the core validation or state management files. The issue mentions copying field issues into form.state.errors; find where this copying occurs and add a configuration option to control it. Test by running the provided CodeSandbox example and verifying that form.state.errors no longer contains field errors when the option is set.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: runtime scope: core type: enhancement v2
Describe the bug

In the current v2, root schema validators copy all field issues into form.state.errors in addition having them in field.errors

Your minimal, reproducible example

https://codesandbox.io/p/devbox/nostalgic-firefly-ng66xx

Steps to reproduce
  1. Attach a Standard Schema to root validators
  2. Trigger validation with an invalid field value
  3. Observe form.state.errors receives a copy of the field error issue alongside the form error
Expected behavior

This issue is best solved by having a configurable option for this behavior, so you are able to access form errors without getting the field errors

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

All

TanStack Form adapter

react-form

TanStack Form version

v2.0.0-alpha.2

TypeScript version

No response

Additional context

No response

Lingua principale
TypeScript
Stelle
6.8k
Fork
705
Merge medio
1g 6h
PR unite (30g)
12

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/form

Tutte le issue di TanStack/form

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.