Closed AsLi-IN closed 1 year ago
Strongly disagree.
A badly formed object doesn't equal undefined. IMO, the developer own the options (and the capability to define how new ones are created) and thus it's their responsibility to make sure they are properly mapped. Plus, this seems easy enough to resolve.
const sanitizedOptions = options.filter(o => o?.value !== undefined)
return <Select options={sanitizedOptions} />
Closing this issue but can reopen if there is any compelling arguments otherwise.
If value and label is undefined i.e
<Select value:{{value: undefined, label: undefined}}
it should display the "Select" placeholder instead of making it empty box.