diff --git a/src/index.tsx b/src/index.tsx index 09c0a2d..5d9b6a0 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -36,7 +36,12 @@ export interface SegmentedProps extends React.HTMLProps { function normalizeOptions(options: SegmentedOptions): SegmentedLabeledOption[] { return options.map((option) => { if (typeof option === 'object') { - return option || {}; + return { + ...option, + // use value as default label + label: + typeof option.label !== 'undefined' ? option.label : option.value, + }; } return { label: option?.toString(),