-
-
Notifications
You must be signed in to change notification settings - Fork 472
Open
Description
I'm trying to create a Select component with a object value.
{
label: `My String`,
value: { CuteCharm: true },
}
This results in a runtime error because value
is rendered here: https://github.com/react-component/select/blob/48e24574fdf6a7b68589631e32d69d8dc629c974/src/OptionList.tsx#L309C9-L309C16

Expected behaviour: value
can be an object, and it is not rendered (only label
is rendered).
Proposed solution: Replace {value}
by {typeof value === 'object' ? value.toString() : value}
Metadata
Metadata
Assignees
Labels
No labels