JedWatson / JedWatson/react-select
makeAnimated components prevent Typescript type inference
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
When creating animated components with makeAnimated() and passing them as components props then the type inference is not working anymore: options are now unknown type:

When removing the components prop then options type is inferred correctly:

https://codesandbox.io/s/react-select-v5-sandbox-forked-net2gc?file=/example.js
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox reproduction in example.js and compare type inference with and without the components prop when using makeAnimated(). Trace the affected TypeScript definitions and verify that the component options are no longer inferred as unknown while preserving the existing inference behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100