T
TanStack•9mo ago
harsh-harlequin

FieldMeta Generic required type arguments

Hi there! I know some of the generics were recently updated in a PR. I'm trying to use FieldMeta and now getting a required type args error for 17 req'd types. Egad! hahah Is there another generic that should be used? Basically trying to abstract an info component for displaying meta info. Thanks!
No description
7 Replies
generous-apricot
generous-apricot•9mo ago
Use AnyFieldMeta type instead
harsh-harlequin
harsh-harlequinOP•9mo ago
ah- cool thanks!! That did the trick!
other-emerald
other-emerald•9mo ago
You shouldn't have to use AnyFieldMeta for any reason - what's the goal of this API usage?
generous-apricot
generous-apricot•9mo ago
I use it for this helper:
export function hasError(field: AnyFieldMeta) {
return field.isTouched && field.errors?.length > 0;
}
export function hasError(field: AnyFieldMeta) {
return field.isTouched && field.errors?.length > 0;
}
passive-yellow
passive-yellow•9mo ago
Could consider useFieldContext to avoid passing the field object entirely
generous-apricot
generous-apricot•9mo ago
Is this already available in solid?
passive-yellow
passive-yellow•9mo ago
Sorry lol idk was thinking in react 🥲

Did you find this page helpful?