Why it shows `any` type
Unanswered
Giant Angora posted this in #help-forum
Giant AngoraOP
hello there...
why
playground https://tsplay.dev/NrEpow
why
options and groupedOptions shows any type when groupBy is definedimport React from 'react'
type SelectProps<Value,> =
{ value?: Value, } & (
| {
groupBy?: undefined,
children?: (props: {
groupedOptions: null;
options: string[];
}) => string
}
| {
groupBy: (option: Value) => string
children?: (props: {
groupedOptions: Record<string, string[]>;
options: null;
}) => string
})
const Select = <Value,>
(props: SelectProps<Value>) => null;
<Select
// groupBy={() => 'option.title'}
>
{({ options, groupedOptions }) => ''}
</Select >playground https://tsplay.dev/NrEpow