JedWatson / JedWatson/react-select

Select Option type hint is too loose (missing "extends object")

Open
#6,042 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/bug-unconfirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

If using number for the Select Option type then you get an error (Cannot use 'in' operator to search for 'options' in 0). This could be checked during type checking by indicating that Option must be an object (or any additional required restrictions) which would be a nice quality of life improvement.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Select Option type definition and reproduce the reported case using number as the Option type. Confirm that type checking rejects non-object options while valid object options remain supported; the runtime 'in' operator error should no longer be reachable through the type hint.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.