Skip to content

Pass something besided string to getOptionLabel()? #4134

@jkjustjoshing

Description

@jkjustjoshing

The docs for getOptionLabel indicate that the only valid return type is a string.
image

However, it seems like a return value of any React node will work, such as the following:

getOptionLabel={(data) => <b>{data.name}</b>}

Should/can the docs be updated to show that anything React can render is an acceptable return type?

Metadata

Metadata

Assignees

Labels

category/accessibilityIssues or PRs related to accessibilitycategory/documentationIssues or PRs about documentation or the website itself

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions