MCPcopy Create free account
hub / github.com/JedWatson/react-select / asOption

Function asOption

packages/react-select/src/components/LiveRegion.tsx:87–88  ·  view source on GitHub ↗
(val: OnChangeValue<Option, IsMulti>)

Source from the content-addressed store, hash-verified

85 } = ariaSelection;
86 // select-option when !isMulti does not return option so we assume selected option is value
87 const asOption = (val: OnChangeValue<Option, IsMulti>): Option | null =>
88 !Array.isArray(val) ? (val as Option) : null;
89
90 // If there is just one item from the action then get its label
91 const selected = removedValue || option || asOption(value);

Callers 1

LiveRegionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected