diff --git a/src/image/Image.tsx b/src/image/Image.tsx index f561ac7db8..35aea54f88 100644 --- a/src/image/Image.tsx +++ b/src/image/Image.tsx @@ -35,7 +35,6 @@ const InternalImage: React.ForwardRefRenderFunction className, src, style, - alt, fit, position, shape, @@ -50,8 +49,14 @@ const InternalImage: React.ForwardRefRenderFunction fallback, onLoad, onError, - ...rest + ...waitPassRest } = props; + const { + // penetrate pass to image tag element props + alt, + referrerpolicy, + ...rest + } = waitPassRest; const { classPrefix } = useConfig(); const imageRef = useRef(null); @@ -127,7 +132,7 @@ const InternalImage: React.ForwardRefRenderFunction // 这里添加setTimeout是因为CSR image渲染时,onError有时快有时慢,会导致执行顺序不同导致的bug setTimeout(() => { if (!isValid && !isFirstError.current) { - // SSR模式下获取不到imaage的合成事件,暂时传递image实例 + // SSR模式下获取不到 image 的合成事件,暂时传递 image 实例 handleError(imgRef.current); } }, 0); @@ -141,7 +146,7 @@ const InternalImage: React.ForwardRefRenderFunction if (imgRef.current) { const { complete, naturalWidth, naturalHeight } = imgRef.current; if (complete && naturalWidth !== 0 && naturalHeight !== 0) { - // SSR模式下获取不到imaage的合成事件,暂时传递image实例 + // SSR模式下获取不到 image 的合成事件,暂时传递 image 实例 handleLoad(imgRef.current); } } @@ -197,6 +202,7 @@ const InternalImage: React.ForwardRefRenderFunction `${classPrefix}-image--position-${position}`, )} alt={alt} + referrerPolicy={referrerpolicy} /> ); };