diff --git a/packages/next/client/future/image.tsx b/packages/next/client/future/image.tsx index e42a606e21dc3..dc64f1640d66b 100644 --- a/packages/next/client/future/image.tsx +++ b/packages/next/client/future/image.tsx @@ -825,10 +825,14 @@ export default function Image({ imageSrcSetPropName = 'imageSrcSet' imageSizesPropName = 'imageSizes' } - const linkProps = { + const linkProps: React.DetailedHTMLProps< + React.LinkHTMLAttributes, + HTMLLinkElement + > = { // Note: imagesrcset and imagesizes are not in the link element type with react 17. [imageSrcSetPropName]: imgAttributes.srcSet, [imageSizesPropName]: imgAttributes.sizes, + crossOrigin: rest.crossOrigin, } const onLoadingCompleteRef = useRef(onLoadingComplete) diff --git a/packages/next/client/image.tsx b/packages/next/client/image.tsx index d986ae3a93c28..4018ca7b7e1f0 100644 --- a/packages/next/client/image.tsx +++ b/packages/next/client/image.tsx @@ -978,10 +978,14 @@ export default function Image({ imageSrcSetPropName = 'imageSrcSet' imageSizesPropName = 'imageSizes' } - const linkProps = { + const linkProps: React.DetailedHTMLProps< + React.LinkHTMLAttributes, + HTMLLinkElement + > = { // Note: imagesrcset and imagesizes are not in the link element type with react 17. [imageSrcSetPropName]: imgAttributes.srcSet, [imageSizesPropName]: imgAttributes.sizes, + crossOrigin: rest.crossOrigin, } const useLayoutEffect = diff --git a/test/integration/image-component/default/pages/priority.js b/test/integration/image-component/default/pages/priority.js index 741ae056ea023..975d7a39c2c13 100644 --- a/test/integration/image-component/default/pages/priority.js +++ b/test/integration/image-component/default/pages/priority.js @@ -12,6 +12,14 @@ const Page = () => { width="400" height="400" > + { width="400" height="400" > +