Closed KMathisGit closed 9 months ago
Getting the same error here. Did you find some workaround that doesn't involve setting the type as any?
<Select
value={colorScheme}
onChange={(event) => setColorScheme(event.target.value)}
>
<Select.Option value={"dark"} disabled>
Pick your favorite Simpson
</Select.Option>
{
Themes.map((theme) => (
<Select.Option key={theme} value={theme}>
{theme}
</Select.Option>
)) as any
}
</Select>
I am trying to create my own wrapper component for
<Select>
to make it more re-usable in my own app.This does work functionally but I am getting type errors on the dynamic mapping part of my options.
The type error I am getting is:
If I remove my 1 static
Select.Option
that I am using as a placeholder value than the type error goes away... I would like to keep the placeholder value and fix this type error but I am having trouble.