mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
type: update unknow with UploadListRef (#43054)
This commit is contained in:
parent
0dcd6e8c22
commit
3b0352178d
@ -6,17 +6,22 @@ import classNames from 'classnames';
|
||||
import type { CSSMotionListProps } from 'rc-motion';
|
||||
import CSSMotion, { CSSMotionList } from 'rc-motion';
|
||||
import * as React from 'react';
|
||||
import type { ButtonProps } from '../../button';
|
||||
import Button from '../../button';
|
||||
import { ConfigContext } from '../../config-provider';
|
||||
import useForceUpdate from '../../_util/hooks/useForceUpdate';
|
||||
import initCollapseMotion from '../../_util/motion';
|
||||
import { cloneElement, isValidElement } from '../../_util/reactNode';
|
||||
import type { ButtonProps } from '../../button';
|
||||
import Button from '../../button';
|
||||
import { ConfigContext } from '../../config-provider';
|
||||
import type { InternalUploadFile, UploadFile, UploadListProps } from '../interface';
|
||||
import { isImageUrl, previewImage } from '../utils';
|
||||
import ListItem from './ListItem';
|
||||
|
||||
const InternalUploadList: React.ForwardRefRenderFunction<unknown, UploadListProps> = (
|
||||
interface UploadListRef {
|
||||
handlePreview: (file: UploadFile, e?: React.SyntheticEvent<HTMLElement>) => void;
|
||||
handleDownload: (file: UploadFile) => void;
|
||||
}
|
||||
|
||||
const InternalUploadList: React.ForwardRefRenderFunction<UploadListRef, UploadListProps> = (
|
||||
props,
|
||||
ref,
|
||||
) => {
|
||||
@ -254,7 +259,7 @@ const InternalUploadList: React.ForwardRefRenderFunction<unknown, UploadListProp
|
||||
);
|
||||
};
|
||||
|
||||
const UploadList = React.forwardRef<unknown, UploadListProps>(InternalUploadList);
|
||||
const UploadList = React.forwardRef<UploadListRef, UploadListProps>(InternalUploadList);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
UploadList.displayName = 'UploadList';
|
||||
|
Loading…
Reference in New Issue
Block a user