question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

valueKey / labelKey do not work as expected.

See original GitHub issue

Hi.

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:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
chillyistkultcommented, Jan 23, 2018

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.

0reactions
bladeycommented, May 27, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found