JedWatson / JedWatson/react-select

[Bug] loadOptions is not passed to custom components

Open
#4,487 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm customizing the components of react-select and I have a use case in which I'd like to know if the select element has been provided with a loadOptions function.

It should be possible to access the props of the customized component, and then the selectProps property, which should then give me all the props that have been passed to the react select. The loadOptions is missing in the list of properties that selectProps is returning.

Here is a repro demo: https://codesandbox.io/s/react-select-v3-sandbox-forked-yns2r?file=/example.js (check line 13)

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 with the linked CodeSandbox and inspect the customized component's props, especially selectProps, to confirm that loadOptions is absent. Trace where selectProps is assembled in react-select and identify the existing component or prop tests covering this behavior. Done means a customized component can observe the supplied loadOptions function and the regression is covered by a test.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.