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 write a reusable component that I want to point to a array-valued property with a certain type via a control and name prop. If I use FieldPathByValue this can't be used in the name property:
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 write a reusable component that I want to point to a array-valued property with a certain type via a control and name prop. If I use FieldPathByValue this can't be used in the name property:
By creating a custom FieldArrayPathByValue there is no error (it's basically FieldPathByValue, but Path replaced with ArrayPath):
It gets rid of the error, but code typescript is still unable to determine the types of the form fields:
So how would I be able to give a type to the field array property? Is there any way to do that?
See: https://codesandbox.io/s/friendly-pond-pe07c8?file=/src/App.tsx
Beta Was this translation helpful? Give feedback.
All reactions