Browse Source

chore: ts optimization (#40258)

pull/40232/head
lijianan 2 years ago
committed by GitHub
parent
commit
a318fabe6c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/button/buttonHelpers.tsx
  2. 2
      components/input/Input.tsx
  3. 4
      components/table/demo/dynamic-settings.tsx

2
components/button/buttonHelpers.tsx

@ -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';
}

2
components/input/Input.tsx

@ -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) {

4
components/table/demo/dynamic-settings.tsx

@ -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…
Cancel
Save