multi value select uses getOptionValue for react key, doesn't work for non-prim values.
See original GitHub issueI use non-primitive values for my options (providing a getOptionLabel to turn them into strings.) The problem is https://github.com/JedWatson/react-select/blob/916ef8f2813dbdd7bb5adb186ab3a085d40003c3/src/Select.js#L1478
uses the value for the react key. When isMulti={true}
, I see a lot of:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Retrieving value from <select> with multiple option in React
The same way you do anywhere else, since you're working with the real DOM node as the target of the change event: handleChange:...
Read more >How to Get Selected Value from a Mapped Select Input in React
Building select input elements is straightforward when working on web projects. But with the emergence of JavaScript frameworks and ...
Read more >Advanced - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, ... Using the react-sortable-hoc package we can easily allow sorting of ...
Read more >Handle the onChange event on a Select element in React
Set the onChange prop on the select element. Keep the value of the selected option in a state variable. Every time the user...
Read more >Lists and Keys - React
This code logs [2, 4, 6, 8, 10] to the console. In React, transforming arrays into lists of elements is nearly identical. Rendering...
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
The good way to work with complex object value is to use
getOptionValue()
andgetOptionLabel()
. It’s not very clear but works very well, as we had exactly the same problem.Nvm, this doesn’t work because the custom component still gets wrapped for some reason 😕