Reputation: 14515
Instead of a simple string using label options:
var options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' }
];
I want to use a custom component with complex data to populate each option. The selected tags could still be a value, label
pair though.
A perfect example:
Upvotes: 1
Views: 3959
Reputation: 42460
Yes, react-select lets you pass in a custom menu component via the menuRenderer
prop:
Renders a custom menu with options; accepts the following named parameters:
menuRenderer({ focusedOption, focusOption, options, selectValue, valueArray })
More info in react-select's docs.
Upvotes: 2