Sfoglia il codice sorgente

chore: simplify some type in ts(#838)

Change-Id: I3958e4d9840750548c2effd92b03a17920596778
忽如寄 3 anni fa
parent
commit
4511313cca

+ 2 - 2
packages/semi-ui/anchor/link.tsx

@@ -11,9 +11,9 @@ const prefixCls = cssClasses.PREFIX;
 
 
 export interface LinkProps {
 export interface LinkProps {
     href?: string;
     href?: string;
-    title?: string | React.ReactNode;
+    title?: ReactNode;
     className?: string;
     className?: string;
-    children?: ReactNode | undefined;
+    children?: ReactNode;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     disabled?: boolean;
     disabled?: boolean;
 }
 }

+ 3 - 3
packages/semi-ui/autoComplete/index.tsx

@@ -57,7 +57,7 @@ export interface AutoCompleteProps<T extends AutoCompleteItems> {
     dropdownMatchSelectWidth?: boolean;
     dropdownMatchSelectWidth?: boolean;
     dropdownClassName?: string;
     dropdownClassName?: string;
     dropdownStyle?: React.CSSProperties;
     dropdownStyle?: React.CSSProperties;
-    emptyContent?: React.ReactNode | null;
+    emptyContent?: React.ReactNode;
     getPopupContainer?: () => HTMLElement;
     getPopupContainer?: () => HTMLElement;
     insetLabel?: React.ReactNode;
     insetLabel?: React.ReactNode;
     insetLabelId?: string;
     insetLabelId?: string;
@@ -218,8 +218,8 @@ class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<AutoComple
 
 
         warning(
         warning(
             'triggerRender' in this.props && typeof this.props.triggerRender === 'function',
             'triggerRender' in this.props && typeof this.props.triggerRender === 'function',
-            `[Semi AutoComplete] 
-            - If you are using the following props: 'suffix', 'prefix', 'showClear', 'validateStatus', and 'size', 
+            `[Semi AutoComplete]
+            - If you are using the following props: 'suffix', 'prefix', 'showClear', 'validateStatus', and 'size',
             please notice that they will be removed in the next major version.
             please notice that they will be removed in the next major version.
             Please use 'componentProps' to retrieve these props instead.
             Please use 'componentProps' to retrieve these props instead.
             - If you are using 'onBlur', 'onFocus', please try to avoid using them and look for changes in the future.`
             - If you are using 'onBlur', 'onFocus', please try to avoid using them and look for changes in the future.`

+ 2 - 2
packages/semi-ui/avatar/interface.ts

@@ -22,7 +22,7 @@ export type AvatarColor =
     | 'yellow';
     | 'yellow';
 
 
 export interface AvatarProps extends BaseProps {
 export interface AvatarProps extends BaseProps {
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     color?: AvatarColor;
     color?: AvatarColor;
     shape?: AvatarShape;
     shape?: AvatarShape;
     size?: AvatarSize;
     size?: AvatarSize;
@@ -42,7 +42,7 @@ export type AvatarGroupSize = 'extra-extra-small' | 'extra-small' | 'small' | 'm
 export type AvatarGroupOverlapFrom = 'start' | 'end';
 export type AvatarGroupOverlapFrom = 'start' | 'end';
 
 
 export interface AvatarGroupProps {
 export interface AvatarGroupProps {
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     shape?: AvatarGroupShape;
     shape?: AvatarGroupShape;
     size?: AvatarGroupSize;
     size?: AvatarGroupSize;
     overlapFrom?: AvatarGroupOverlapFrom;
     overlapFrom?: AvatarGroupOverlapFrom;

+ 1 - 1
packages/semi-ui/badge/index.tsx

@@ -24,7 +24,7 @@ export interface BadgeProps {
     onMouseEnter?: (e: React.MouseEvent) => any;
     onMouseEnter?: (e: React.MouseEvent) => any;
     onMouseLeave?: (e: React.MouseEvent) => any;
     onMouseLeave?: (e: React.MouseEvent) => any;
     onClick?: (e: React.MouseEvent) => any;
     onClick?: (e: React.MouseEvent) => any;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
 }
 }
 
 
 export default class Badge extends PureComponent<BadgeProps> {
 export default class Badge extends PureComponent<BadgeProps> {

+ 4 - 4
packages/semi-ui/banner/index.tsx

@@ -20,15 +20,15 @@ export type Type = 'info' | 'danger' | 'warning' | 'success';
 export interface BannerProps {
 export interface BannerProps {
     type?: Type;
     type?: Type;
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     fullMode?: boolean;
     fullMode?: boolean;
     title?: React.ReactNode;
     title?: React.ReactNode;
     description?: React.ReactNode;
     description?: React.ReactNode;
-    icon?: string | React.ReactNode;
-    closeIcon?: string | React.ReactNode;
+    icon?: React.ReactNode;
+    closeIcon?: React.ReactNode;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     bordered?: boolean;
     bordered?: boolean;
-    onClose?: (e: React.MouseEvent) => void;
+    onClose?(e: React.MouseEvent):void;
 }
 }
 
 
 export interface BannerState {
 export interface BannerState {

+ 1 - 1
packages/semi-ui/breadcrumb/bread-context.tsx

@@ -5,7 +5,7 @@ export interface BreadContextType {
     onClick?: (info: BreadcrumbItemInfo, event: React.MouseEvent) => void;
     onClick?: (info: BreadcrumbItemInfo, event: React.MouseEvent) => void;
     showTooltip?: boolean | showToolTipProps;
     showTooltip?: boolean | showToolTipProps;
     compact?: boolean;
     compact?: boolean;
-    separator?: string | React.ReactNode;
+    separator?: React.ReactNode;
 }
 }
 
 
 const BreadContext = React.createContext<BreadContextType>({});
 const BreadContext = React.createContext<BreadContextType>({});

+ 1 - 1
packages/semi-ui/card/cardGroup.tsx

@@ -11,7 +11,7 @@ export type CardGroupType = 'grid';
 export interface CardGroupProps {
 export interface CardGroupProps {
     /** Card group style class name */
     /** Card group style class name */
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     /** Card Spacing */
     /** Card Spacing */
     spacing?: number | number[];
     spacing?: number | number[];
     /** Card group inline style */
     /** Card group inline style */

+ 1 - 1
packages/semi-ui/card/index.tsx

@@ -26,7 +26,7 @@ export interface CardProps {
     bordered?: boolean;
     bordered?: boolean;
     /** Style class name */
     /** Style class name */
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     /** Cover */
     /** Cover */
     cover?: ReactNode;
     cover?: ReactNode;
     /** Additional additions to the right of the title */
     /** Additional additions to the right of the title */

+ 4 - 4
packages/semi-ui/cascader/index.tsx

@@ -62,7 +62,7 @@ export interface CascaderProps extends BasicCascaderProps {
     motion?: Motion;
     motion?: Motion;
     treeData?: Array<CascaderData>;
     treeData?: Array<CascaderData>;
     restTagsPopoverProps?: PopoverProps;
     restTagsPopoverProps?: PopoverProps;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     value?: Value;
     value?: Value;
     prefix?: ReactNode;
     prefix?: ReactNode;
     suffix?: ReactNode;
     suffix?: ReactNode;
@@ -843,11 +843,11 @@ class Cascader extends BaseComponent<CascaderProps, CascaderState> {
         const allowClear = this.showClearBtn();
         const allowClear = this.showClearBtn();
         if (allowClear) {
         if (allowClear) {
             return (
             return (
-                <div 
+                <div
                     className={clearCls}
                     className={clearCls}
-                    onClick={this.handleClear} 
+                    onClick={this.handleClear}
                     onKeyPress={this.handleClearEnterPress}
                     onKeyPress={this.handleClearEnterPress}
-                    role='button' 
+                    role='button'
                     tabIndex={0}
                     tabIndex={0}
                 >
                 >
                     <IconClear />
                     <IconClear />

+ 1 - 1
packages/semi-ui/collapse/index.tsx

@@ -20,7 +20,7 @@ export { CollapsePanelProps } from './item';
 export interface CollapseReactProps extends CollapseProps{
 export interface CollapseReactProps extends CollapseProps{
     expandIcon?: React.ReactNode;
     expandIcon?: React.ReactNode;
     collapseIcon?: React.ReactNode;
     collapseIcon?: React.ReactNode;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     style?: CSSProperties;
     style?: CSSProperties;
     onChange?: (activeKey: CollapseProps['activeKey'], e: React.MouseEvent) => void;
     onChange?: (activeKey: CollapseProps['activeKey'], e: React.MouseEvent) => void;
 }
 }

+ 1 - 1
packages/semi-ui/collapse/item.tsx

@@ -12,7 +12,7 @@ export interface CollapsePanelProps {
     extra?: ReactNode;
     extra?: ReactNode;
     header?: ReactNode;
     header?: ReactNode;
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     reCalcKey?: number | string;
     reCalcKey?: number | string;
     style?: CSSProperties;
     style?: CSSProperties;
 }
 }

+ 1 - 1
packages/semi-ui/collapsible/index.tsx

@@ -11,7 +11,7 @@ const ease = 'cubicBezier(.25,.1,.25,1)';
 
 
 export interface CollapsibleProps {
 export interface CollapsibleProps {
     motion?: Motion;
     motion?: Motion;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     isOpen?: boolean;
     isOpen?: boolean;
     duration?: number;
     duration?: number;
     keepDOM?: boolean;
     keepDOM?: boolean;

+ 1 - 1
packages/semi-ui/descriptions/item.tsx

@@ -7,7 +7,7 @@ import DescriptionsContext, { DescriptionsContextValue } from './descriptions-co
 export interface DescriptionsItemProps {
 export interface DescriptionsItemProps {
     hidden?: boolean;
     hidden?: boolean;
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined | (() => React.ReactNode);
+    children?: React.ReactNode | (() => React.ReactNode);
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     itemKey?: React.ReactNode;
     itemKey?: React.ReactNode;
 }
 }

+ 1 - 1
packages/semi-ui/empty/index.tsx

@@ -23,7 +23,7 @@ export interface EmptyProps {
     darkModeImage?: React.ReactNode | SVGNode;
     darkModeImage?: React.ReactNode | SVGNode;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
 }
 }
 
 
 interface EmptyState {
 interface EmptyState {

+ 1 - 1
packages/semi-ui/form/errorMessage.tsx

@@ -7,7 +7,7 @@ import { IconAlertTriangle, IconAlertCircle } from '@douyinfe/semi-icons';
 
 
 const prefix = cssClasses.PREFIX;
 const prefix = cssClasses.PREFIX;
 
 
-export type ReactFieldError = boolean | string | Array<any> | React.ReactNode | undefined;
+export type ReactFieldError = Array<any> | React.ReactNode;
 
 
 export interface ErrorMessageProps {
 export interface ErrorMessageProps {
     error?: ReactFieldError;
     error?: ReactFieldError;

+ 1 - 1
packages/semi-ui/form/interface.ts

@@ -21,7 +21,7 @@ export type CommonFieldProps = {
     /** Field is required (except Form. Checkbox within the Group, Form. Radio) */
     /** Field is required (except Form. Checkbox within the Group, Form. Radio) */
     field: string;
     field: string;
     /** The label text of the form control is the same name as the field by default when it is not passed */
     /** The label text of the form control is the same name as the field by default when it is not passed */
-    label?: string | LabelProps | React.ReactNode | number;
+    label?: LabelProps | React.ReactNode;
     labelPosition?: 'top' | 'left' | 'inset';
     labelPosition?: 'top' | 'left' | 'inset';
     labelAlign?: 'left' | 'right';
     labelAlign?: 'left' | 'right';
     labelWidth?: number | string;
     labelWidth?: number | string;

+ 1 - 1
packages/semi-ui/form/label.tsx

@@ -20,7 +20,7 @@ export interface LabelProps {
     width?: number | string;
     width?: number | string;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     extra?: React.ReactNode;
     extra?: React.ReactNode;
 }
 }
 
 

+ 2 - 2
packages/semi-ui/form/section.tsx

@@ -9,8 +9,8 @@ const prefix = cssClasses.PREFIX;
 export interface SectionProps {
 export interface SectionProps {
     className?: string;
     className?: string;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
-    text?: React.ReactNode | string;
-    children?: React.ReactNode | undefined;
+    text?: React.ReactNode;
+    children?: React.ReactNode;
 }
 }
 
 
 export default class Section extends PureComponent<SectionProps> {
 export default class Section extends PureComponent<SectionProps> {

+ 1 - 1
packages/semi-ui/form/slot.tsx

@@ -13,7 +13,7 @@ const prefix = cssClasses.PREFIX;
 export interface SlotProps {
 export interface SlotProps {
     className?: string;
     className?: string;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
-    label?: LabelProps | React.ReactNode | number | string;
+    label?: LabelProps | React.ReactNode;
     noLabel?: boolean;
     noLabel?: boolean;
     labelPosition?: 'top' | 'left';
     labelPosition?: 'top' | 'left';
     error?: ErrorMessageProps;
     error?: ErrorMessageProps;

+ 1 - 1
packages/semi-ui/layout/Sider.tsx

@@ -38,7 +38,7 @@ export interface SiderProps {
     prefixCls?: string;
     prefixCls?: string;
     style?: CSSProperties;
     style?: CSSProperties;
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     breakpoint?: Array<keyof ResponsiveMap>;
     breakpoint?: Array<keyof ResponsiveMap>;
     onBreakpoint?: (screen: keyof ResponsiveMap, match: boolean) => void;
     onBreakpoint?: (screen: keyof ResponsiveMap, match: boolean) => void;
     'aria-label'?: React.AriaAttributes['aria-label'];
     'aria-label'?: React.AriaAttributes['aria-label'];

+ 1 - 1
packages/semi-ui/list/index.tsx

@@ -17,7 +17,7 @@ export { ListItemProps } from './item';
 export interface ListProps<T> {
 export interface ListProps<T> {
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     bordered?: boolean;
     bordered?: boolean;
     footer?: React.ReactNode;
     footer?: React.ReactNode;
     header?: React.ReactNode;
     header?: React.ReactNode;

+ 1 - 1
packages/semi-ui/list/item.tsx

@@ -12,7 +12,7 @@ export interface ListItemProps {
     main?: React.ReactNode;
     main?: React.ReactNode;
     align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
     align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     onClick?: React.MouseEventHandler<HTMLLIElement>;
     onClick?: React.MouseEventHandler<HTMLLIElement>;
     onRightClick?: React.MouseEventHandler<HTMLLIElement>;
     onRightClick?: React.MouseEventHandler<HTMLLIElement>;

+ 1 - 1
packages/semi-ui/modal/Modal.tsx

@@ -23,7 +23,7 @@ export type Directions = 'ltr' | 'rtl';
 
 
 export interface ModalReactProps extends ModalProps {
 export interface ModalReactProps extends ModalProps {
     cancelButtonProps?: ButtonProps;
     cancelButtonProps?: ButtonProps;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     okButtonProps?: ButtonProps;
     okButtonProps?: ButtonProps;
     bodyStyle?: CSSProperties;
     bodyStyle?: CSSProperties;
     maskStyle?: CSSProperties;
     maskStyle?: CSSProperties;

+ 1 - 1
packages/semi-ui/modal/ModalContent.tsx

@@ -21,7 +21,7 @@ let uuid = 0;
 
 
 
 
 export interface ModalContentReactProps extends ModalContentProps {
 export interface ModalContentReactProps extends ModalContentProps {
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
 }
 }
 export default class ModalContent extends BaseComponent<ModalContentReactProps, ModalContentState> {
 export default class ModalContent extends BaseComponent<ModalContentReactProps, ModalContentState> {
     static contextType = ConfigContext;
     static contextType = ConfigContext;

+ 2 - 2
packages/semi-ui/navigation/Footer.tsx

@@ -10,7 +10,7 @@ import NavContext, { NavContextType } from './nav-context';
 import { BaseProps } from '../_base/baseComponent';
 import { BaseProps } from '../_base/baseComponent';
 
 
 export interface NavFooterProps extends BaseProps {
 export interface NavFooterProps extends BaseProps {
-    collapseButton?: React.ReactNode | boolean;
+    collapseButton?: React.ReactNode;
     collapseText?: (collapsed?: boolean) => React.ReactNode;
     collapseText?: (collapsed?: boolean) => React.ReactNode;
 }
 }
 
 
@@ -28,7 +28,7 @@ export default class NavFooter extends PureComponent<NavFooterProps> {
     static defaultProps = {
     static defaultProps = {
         collapseButton: false,
         collapseButton: false,
     };
     };
-    
+
     context: NavContextType;
     context: NavContextType;
 
 
     renderCollapseButton = () => {
     renderCollapseButton = () => {

+ 1 - 1
packages/semi-ui/radio/radioGroup.tsx

@@ -30,7 +30,7 @@ export type RadioGroupProps = {
     value?: string | number;
     value?: string | number;
     onChange?: (event: RadioChangeEvent) => void;
     onChange?: (event: RadioChangeEvent) => void;
     className?: string;
     className?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     direction?: ArrayElement<typeof strings.DIRECTION_SET>;
     direction?: ArrayElement<typeof strings.DIRECTION_SET>;
     mode?: RadioMode;
     mode?: RadioMode;

+ 7 - 7
packages/semi-ui/select/index.tsx

@@ -51,7 +51,7 @@ type ExcludeInputType = {
 type OnChangeValueType = string | number | Record<string, any>;
 type OnChangeValueType = string | number | Record<string, any>;
 export interface optionRenderProps {
 export interface optionRenderProps {
     key?: any;
     key?: any;
-    label?: string | React.ReactNode | number;
+    label?: React.ReactNode;
     value?: string | number;
     value?: string | number;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     className?: string;
     className?: string;
@@ -447,11 +447,11 @@ class Select extends BaseComponent<SelectProps, SelectState> {
                 let options = [];
                 let options = [];
                 const { optionList } = this.props;
                 const { optionList } = this.props;
                 if (optionList && optionList.length) {
                 if (optionList && optionList.length) {
-                    options = optionList.map((itemOpt, index) => ({ 
-                        _show: true, 
-                        _selected: false, 
+                    options = optionList.map((itemOpt, index) => ({
+                        _show: true,
+                        _selected: false,
                         _scrollIndex: index,
                         _scrollIndex: index,
-                        ...itemOpt 
+                        ...itemOpt
                     }));
                     }));
                     optionGroups[0] = { children: options, label: '' };
                     optionGroups[0] = { children: options, label: '' };
                 } else {
                 } else {
@@ -773,7 +773,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
                 const groupContent = <OptionGroup {...parentGroup} key={parentGroup.label} />;
                 const groupContent = <OptionGroup {...parentGroup} key={parentGroup.label} />;
                 groupStatus.set(parentGroup.label, true);
                 groupStatus.set(parentGroup.label, true);
                 content.push(groupContent);
                 content.push(groupContent);
-            } 
+            }
             content.push(optionContent);
             content.push(optionContent);
         });
         });
 
 
@@ -901,7 +901,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
                 content: optionNode.label,
                 content: optionNode.label,
             });
             });
         }
         }
-        
+
         const mapItems = maxTagCount ? selectedItems.slice(0, maxTagCount) : selectedItems; // no need to render rest tag when maxTagCount is setting
         const mapItems = maxTagCount ? selectedItems.slice(0, maxTagCount) : selectedItems; // no need to render rest tag when maxTagCount is setting
 
 
         const tags = mapItems.map((item, i) => {
         const tags = mapItems.map((item, i) => {

+ 1 - 1
packages/semi-ui/sideSheet/SideSheetContent.tsx

@@ -23,7 +23,7 @@ export interface SideSheetContentProps {
     style: CSSProperties;
     style: CSSProperties;
     bodyStyle?: CSSProperties;
     bodyStyle?: CSSProperties;
     className: string;
     className: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     footer?: React.ReactNode;
     footer?: React.ReactNode;
     'aria-label'?: string;
     'aria-label'?: string;
 }
 }

+ 1 - 1
packages/semi-ui/table/interface.ts

@@ -240,7 +240,7 @@ export type RowSelectionOnSelect<RecordType> = (
     nativeEvent?: React.MouseEvent
     nativeEvent?: React.MouseEvent
 ) => void;
 ) => void;
 export type RowSelectionOnSelectAll<RecordType> = (selected?: boolean, selectedRows?: RecordType[], changedRows?: RecordType[]) => void;
 export type RowSelectionOnSelectAll<RecordType> = (selected?: boolean, selectedRows?: RecordType[], changedRows?: RecordType[]) => void;
-export type ExpandIcon = ((expanded?: boolean) => React.ReactNode) | React.ReactNode | boolean;
+export type ExpandIcon = ((expanded?: boolean) => React.ReactNode) | React.ReactNode;
 export type ExpandedRowRender<RecordType> = (record?: RecordType, index?: number, expanded?: boolean) => React.ReactNode;
 export type ExpandedRowRender<RecordType> = (record?: RecordType, index?: number, expanded?: boolean) => React.ReactNode;
 export type Footer<RecordType> = ReactNode | ((pageData?: RecordType[]) => React.ReactNode);
 export type Footer<RecordType> = ReactNode | ((pageData?: RecordType[]) => React.ReactNode);
 export type FormatPageText = ((pageInfo?: { currentStart?: number; currentEnd?: number; total?: number }) => React.ReactNode) | boolean;
 export type FormatPageText = ((pageInfo?: { currentStart?: number; currentEnd?: number; total?: number }) => React.ReactNode) | boolean;

+ 1 - 1
packages/semi-ui/timeline/index.tsx

@@ -17,7 +17,7 @@ export interface TimelineProps extends Pick<React.AriaAttributes, 'aria-label'>
     className?: string;
     className?: string;
     style?: React.CSSProperties;
     style?: React.CSSProperties;
     dataSource?: Data[];
     dataSource?: Data[];
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
 }
 }
 
 
 const prefixCls = cssClasses.PREFIX;
 const prefixCls = cssClasses.PREFIX;

+ 1 - 1
packages/semi-ui/timeline/item.tsx

@@ -7,7 +7,7 @@ import '@douyinfe/semi-foundation/timeline/timeline.scss';
 
 
 export interface TimelineItemProps {
 export interface TimelineItemProps {
     color?: string;
     color?: string;
-    children?: React.ReactNode | undefined;
+    children?: React.ReactNode;
     time?: React.ReactNode;
     time?: React.ReactNode;
     type?: 'default' | 'ongoing' | 'success' | 'warning' | 'error';
     type?: 'default' | 'ongoing' | 'success' | 'warning' | 'error';
     dot?: React.ReactNode;
     dot?: React.ReactNode;