I have a question.
So Antd provides custom Select input and with it some functions like onSelect, onChange etc.
I'm using onSelect and this is what this function passes as arguments:
(JSX attribute) onSelect?: ((value: string | number | LabeledValue, option: OptionData |
OptionGroupData) => void) | undefined
So my handleSelect function gets 2 arguments, the first is the value of an option itself and the second one is the whole option tag with all data.
I was able to figure out value type and import it from antd but for option I cannot find any suitable files to import it type from, so I'm getting an error because I can't set my second arg type properly
const handleSelect: (value: SelectValue, option: any) => void
And the option arg she be type:
option: OptionData | OptionGroupData) => void) | undefined
How am I suppose to set this type, where can I get it from?
Don't know if implementations changed since this question was made, but we solved importing:
import { OptionData, OptionGroupData } from "rc-select/lib/interface"
And where needed the type
option: OptionData | OptionGroupData | undefined
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With