mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
chore: ts optimization (#40258)
This commit is contained in:
parent
bde9c6b9fb
commit
a318fabe6c
@ -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';
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user