valueKey / labelKey do not work as expected.
See original GitHub issueHi.
I have the same issue as https://github.com/JedWatson/react-select/issues/1807 (which is closed). I have an array of currencies:
const currencies = [{ code: "USD", name: "American Dollar", symbol: "$"}, ...]
and for my value and label keys I specify valueKey="code"
. But react-select craps out and won’t render properly. Only works if my object has the value
prop.
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
react-select-old - npm
You can customise the valueKey and labelKey props to use a different option shape. Custom classNames. You can provide a custom className prop...
Read more >Selector from material-ui doesn't work for me? - Stack Overflow
You are trying to import the Select component from ... option is named value and the label key is named label , not...
Read more >Upgrade guide for v2 - React Select
This means the labelKey and valueKey props are no longer supported. Instead, you can use the following props to customise how react-select deals...
Read more ><ResourceSelect /> | Availity React Docs
Note: the valueKey prop will only work if you also pass false to the raw prop. ... If present, the network request is...
Read more >Spread values to an object (Computed property names)
I have a function that creates an array of objects for a Drop-Down component (react-select). The function gets data , valueKey , labelKey...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks like it only works if you set
simpleValue={true}
. But if you have multiselection enabled, the simpleValues get concatenated to a string instead of an array.Hello -
In an effort to sustain the
react-select
project going forward, we’re closing old issues / pull requests.We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest version.
If you aren’t using the latest version of
react-select
please consider upgrading to see if it resolves any issues you’re having.However, if you feel this issue / pull request is still relevant and you’d like us to review it - please leave a comment and we’ll do our best to get back to you!