chore: ts optimization (#40258)

This commit is contained in:
lijianan 2023-01-16 15:13:16 +08:00 committed by GitHub
parent bde9c6b9fb
commit a318fabe6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ export function isString(str: any) {
return typeof str === 'string';
}
export function isUnBorderedButtonType(type: ButtonType | undefined) {
export function isUnBorderedButtonType(type?: ButtonType) {
return type === 'text' || type === 'link';
}

View File

@ -39,7 +39,7 @@ export function resolveOnChange<E extends HTMLInputElement | HTMLTextAreaElement
| React.ChangeEvent<E>
| React.MouseEvent<HTMLElement, MouseEvent>
| React.CompositionEvent<HTMLElement>,
onChange: undefined | ((event: React.ChangeEvent<E>) => void),
onChange?: (event: React.ChangeEvent<E>) => void,
targetValue?: string,
) {
if (!onChange) {

View File

@ -92,12 +92,12 @@ const App: React.FC = () => {
const [showfooter, setShowFooter] = useState(true);
const [rowSelection, setRowSelection] = useState<TableRowSelection<DataType> | undefined>({});
const [hasData, setHasData] = useState(true);
const [tableLayout, setTableLayout] = useState(undefined);
const [tableLayout, setTableLayout] = useState();
const [top, setTop] = useState<TablePaginationPosition | 'none'>('none');
const [bottom, setBottom] = useState<TablePaginationPosition>('bottomRight');
const [ellipsis, setEllipsis] = useState(false);
const [yScroll, setYScroll] = useState(false);
const [xScroll, setXScroll] = useState<string | undefined>(undefined);
const [xScroll, setXScroll] = useState<string>();
const handleBorderChange = (enable: boolean) => {
setBordered(enable);