The Dropdown options property accepts a single value or an array of values.
In most cases however, the 'dataprovider' of a dropdown would be an array of objects retrieved from a service.
Referencing a selected object in the dropdown is important. So I set the value property in the options to the object itself.
To see an example, here's a codesandbox.
As you can see, this works perfectly but two warnings will be thrown in the console:
Warning: Failed prop type: Invalid prop `options[0].value` supplied to `Dropdown`.
in Dropdown`
Warning: Failed prop type: Invalid prop `value` supplied to `DropdownItem`.
in DropdownItem`
If passing object as value to the options property works without a problem, then the warning should be omitted.
You should pass value as string it's a known limitation and there will be no changes in a short-term.
Has there been a discussion in the past on this topic? It's a very handy feature and it actually _works_
You can search in our issues. actually it's works partially. There are many places in the Dropdown component where it uses === (deep equal) check on values and will silently break the object compassion.
Most helpful comment
You should pass
valueasstringit's a known limitation and there will be no changes in a short-term.