Closed beerose closed 1 year ago
Yes, it returns a string
for accessibility reasons (so that it can be read by a screen reader).
If you would like to use a React element for the option label, take a look at the formatOptionLabel
prop which is intended for this purpose.
Ok, that makes sense. Thanks!
Is there a reason why a function passed to
getOptionLabel
has to return a string? Based on the code, it can render a React component. (I'm also using it aso => ReactElement
and it works fine).I'd be happy to send a PR that updates the types, examples, and docs.