You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After talking with @aadito123, who's working on this issue (reassigning the GH issue, evidently can't), I think we need to change our formError to:
exporttypeFormState<TData>={formErrors?: ValidationError[]// Computed, just like `FieldAPI`formErrorMap?: ValidationErrorMap// Not in this PR, but in some follow-upfieldErrors?: Record<DeepKeys<TData>,ValidationError[]>fieldErrorMap?: Record<DeepKeys<TData>,ValidationErrorMap>// ...}
So that our users can both:
See the form errors on a per-validator method
Match FieldAPI's API
See all fields' errors to render them somewhere outside of Field if required
Update
@aadito123 correctly pointed out that we don't need fieldErrors, as we already have fieldMeta.
Activity
hiddentao commentedon Sep 24, 2023
Yes please. Just missing this now.
crutchcorn commentedon Oct 9, 2023
Adding a bit of context, maybe @aadito123 can tackle while I'm working on schema based validation:
This code was removed here: 884235f
And needs to be added back akin to this bit of code:
form/packages/form-core/src/FieldApi.ts
Lines 290 to 389 in 0159e61
crutchcorn commentedon Oct 31, 2023
After talking with @aadito123, who's working on this issue (
reassigning the GH issue, evidently can't), I think we need to change ourformErrorto:So that our users can both:
FieldAPI's APISee all fields' errors to render them somewhere outside ofFieldif requiredUpdate
@aadito123 correctly pointed out that we don't need
fieldErrors, as we already havefieldMeta.