T
TanStack•6mo ago
other-emerald

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
stormy-gold
stormy-gold•6mo ago
Use AnyFieldMeta type instead
other-emerald
other-emeraldOP•6mo ago
ah- cool thanks!! That did the trick!
flat-fuchsia
flat-fuchsia•6mo ago
You shouldn't have to use AnyFieldMeta for any reason - what's the goal of this API usage?
stormy-gold
stormy-gold•6mo 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;
}
manual-pink
manual-pink•6mo ago
Could consider useFieldContext to avoid passing the field object entirely
stormy-gold
stormy-gold•6mo ago
Is this already available in solid?
manual-pink
manual-pink•6mo ago
Sorry lol idk was thinking in react 🥲

Did you find this page helpful?