Skip to content

Commit

Permalink
fix(image): forget pass referrerpolicy to real image tag props #2810
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Mar 21, 2024
1 parent 2ce5f99 commit d685586
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const InternalImage: React.ForwardRefRenderFunction<HTMLDivElement, ImageProps>
className,
src,
style,
alt,
fit,
position,
shape,
Expand All @@ -50,8 +49,14 @@ const InternalImage: React.ForwardRefRenderFunction<HTMLDivElement, ImageProps>
fallback,
onLoad,
onError,
...rest
...waitPassRest
} = props;
const {
// penetrate pass to image tag element props
alt,
referrerpolicy,
...rest
} = waitPassRest;

const { classPrefix } = useConfig();
const imageRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -197,6 +202,7 @@ const InternalImage: React.ForwardRefRenderFunction<HTMLDivElement, ImageProps>
`${classPrefix}-image--position-${position}`,
)}
alt={alt}
referrerPolicy={referrerpolicy}
/>
);
};
Expand Down

0 comments on commit d685586

Please sign in to comment.