Is there a way to use TS generics with custom components? #5616
Unanswered
kamilkazmierczakMtab
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to provide custom components but it all breaks because I can not infer types in them - I do not want to have fixed types for Option, IsMulti and other types because it makes whole component to be not as flexible as it is suppose to be.
Is there a way to do that?
I prepared example here:
https://codesandbox.io/s/floral-haze-bo8g7b?file=/src/App.tsx
You can uncomment
DropdownIndicator
and you will see errors likeProperty 'valueX' does not exist on type 'unknown'.ts
I am aware that I can passDropdownIndicatorProps<any, false>
or some CustomOption but it is not the point and also it's not only problem with Option type but with IsMulti and othersBeta Was this translation helpful? Give feedback.
All reactions