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
I'm trying to create a reusable component that will accept a Field prop and a generic data type. I'm able to achieve this with the type Field: FieldComponent<TParentData, ZodValidator>; but if I want the field to be an array I run into a type error when doing this:
<Field name={selector} mode="array">
{field => (
{field.state.value.map((_, i) => (
...
Property 'map' does not exist on type 'DeepValue<TParentData, unknown extends TParentData ? string : TParentData extends readonly any[] & IsTuple<TParentData> ? PrefixTupleAccessor<...> : TParentData extends any[] ? PrefixArrayAccessor<...> : TParentData extends Date ? never : TParentData extends object ? PrefixObjectAccessor<...> : TParentData extends s...'.
Have I got something missing/wrong with my Field type?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to create a reusable component that will accept a
Field
prop and a generic data type. I'm able to achieve this with the typeField: FieldComponent<TParentData, ZodValidator>;
but if I want the field to be an array I run into a type error when doing this:Have I got something missing/wrong with my
Field
type?Beta Was this translation helpful? Give feedback.
All reactions