diff --git a/src/Image.tsx b/src/Image.tsx index 7a36c170..04268165 100644 --- a/src/Image.tsx +++ b/src/Image.tsx @@ -68,14 +68,15 @@ const ImageInternal: CompoundedComponent = ({ useMap, ...otherProps }) => { - const src = (preview as ImagePreviewType)?.src ?? imgSrc; const isCustomPlaceholder = placeholder && placeholder !== true; const { + src: previewSrc, visible: previewVisible = undefined, onVisibleChange: onPreviewVisibleChange = onInitialPreviewClose, getContainer: getPreviewContainer = undefined, mask: previewMask, }: ImagePreviewType = typeof preview === 'object' ? preview : {}; + const src = previewSrc ?? imgSrc; const isControlled = previewVisible !== undefined; const [isShowPreview, setShowPreview] = useMergedState(!!previewVisible, { value: previewVisible,