Replies: 2 comments
-
Also running into this. I think it has to do with the fact that your generic I've been trying many ideas but to no avail ... |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, I created a PR that demonstrates a Lens approach for building reusable components with TypeScript support #12284 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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