diff --git a/src/index.tsx b/src/index.tsx index e492106..7b60da6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,28 +6,31 @@ import * as React from 'react'; import MotionThumb from './MotionThumb'; -export interface SegmentedLabeledOption { +export interface SegmentedLabeledOption { className?: string; disabled?: boolean; label: React.ReactNode; - value: T; + value: Value; /** * html `title` property for label */ title?: string; } -type SegmentedOptions = (T | SegmentedLabeledOption)[]; +type SegmentedOptions = ( + | Value + | SegmentedLabeledOption +)[]; -export interface SegmentedProps +export interface SegmentedProps extends Omit< React.HTMLProps, 'value' | 'defaultValue' | 'onChange' > { - options: SegmentedOptions; - defaultValue?: T; - value?: T; - onChange?: (value: T) => void; + options: SegmentedOptions; + defaultValue?: Value; + value?: Value; + onChange?: (value: Value) => void; disabled?: boolean; prefixCls?: string; direction?: 'ltr' | 'rtl'; @@ -218,8 +221,8 @@ const InternalSegmented: React.ForwardRefRenderFunction< const Segmented = React.forwardRef( InternalSegmented, -) as (( - props: SegmentedProps & { ref?: React.Ref }, +) as (( + props: SegmentedProps & { ref?: React.Ref }, ) => React.ReactElement) & { displayName?: string }; if (process.env.NODE_ENV !== 'production') {