diff --git a/src/common.ts b/src/common.ts index cf41a5950..89c59d0e5 100644 --- a/src/common.ts +++ b/src/common.ts @@ -5,7 +5,7 @@ import { ReactElement, ReactNode, CSSProperties, FormEvent, DragEvent, Synthetic // TElement 表示 API 只接受传入组件 export type TElement = T extends undefined ? ReactElement : (props: T) => ReactElement; // 1. TNode = ReactNode; 2. TNode = (props: T) => ReactNode -export type TNode = T extends undefined ? ReactNode | (() => ReactNode) : ReactNode | ((props: T) => ReactNode); +export type TNode = T extends undefined ? ReactNode : (props: T) => ReactNode; export type AttachNodeReturnValue = HTMLElement | Element | Document; export type AttachNode = CSSSelector | ((triggerNode?: HTMLElement) => AttachNodeReturnValue); diff --git a/src/navbar/Navbar.tsx b/src/navbar/Navbar.tsx index 0d6f99855..aa1f7d2c6 100644 --- a/src/navbar/Navbar.tsx +++ b/src/navbar/Navbar.tsx @@ -1,4 +1,5 @@ -import React, { CSSProperties, useCallback, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; +import type { CSSProperties } from 'react'; import { ChevronLeftIcon } from 'tdesign-icons-react'; import ClassNames from 'classnames'; import useConfig from '../_util/useConfig';