Skip to content

Commit

Permalink
feat(Image): preview-src prop
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcch committed Dec 30, 2020
1 parent 24831c6 commit 0eead12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ const ImageInternal: CompoundedComponent<ImageProps> = ({
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,
Expand Down

0 comments on commit 0eead12

Please sign in to comment.