The type of data that the array holds.
// An example of a react component that needs a value of an array, but you only care about a single selection.
const [value, setValue] = useState<TypesOfPie>();
const _values = useMemo(() => value ? [value] : [], [value]);
const _setValues = setFirst.bind(null, setValue, undefined);
return <ComponentWithMultiSelectSupport values={_values} onValuesChange={_setValues} />
Represents a setter function for when you want to set a single value, but you have an array instead.
This is useful when you want to support lists of items, but you need backwards compatibility for setting a single item. This is primarily meant to be use with bind to construct a new method setter that takes an array and forwards it to a setter method which will accept a single value of the first item in the target value.