Repository navigation
Anyone can help me with types of react-select #6073
Replies: 1 comment
|
One thing worth checking is whether you’re explicitly providing the generics expected by react-select. The Select component uses three generic parameters:
For example: import Select, { type MultiValue, type SingleValue } from 'react-select'; The important distinction is that single-select returns Option | null, while multi-select returns readonly Option[]. If you’re wrapping Select inside a custom component, make sure you forward the generic parameters instead of allowing TypeScript to infer everything as unknown. Official documentation: If this doesn’t resolve your reproduction, sharing the exact TypeScript error and the component declaration would help identify the underlying issue. |
Uh oh!
There was an error while loading. Please reload this page.
When I use the component the typings don't work, could you tell me why and how to fix it?
the typings are not based on the lib...

this repository is a compact version of my app for help you to reproduce:
https://github.com/vandsonfalcao/react-select-typescript-error/
All reactions