From 2a7b22acc5a5c8c807e06d6f7ea3bfec32be50eb Mon Sep 17 00:00:00 2001 From: Paul Hachmang Date: Mon, 22 Jan 2024 10:56:58 +0100 Subject: [PATCH] Move to fetchPriority for eagerly loading images instead of using `` --- packages/image/components/Image.tsx | 36 ++--------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/packages/image/components/Image.tsx b/packages/image/components/Image.tsx index 5badd13795..6391f857ee 100644 --- a/packages/image/components/Image.tsx +++ b/packages/image/components/Image.tsx @@ -497,6 +497,7 @@ const Image = React.forwardRef( height={height} data-nimg sx={[style, ...(Array.isArray(sx) ? sx : [sx])]} + fetchPriority={loading === 'eager' ? 'high' : undefined} /> ) : ( @@ -518,43 +519,10 @@ const Image = React.forwardRef( sizes={sizes} data-nimg decoding='async' + fetchPriority={loading === 'eager' ? 'high' : undefined} /> )} - {loading === 'eager' && ( - - {unoptimized ? ( - - ) : ( - <> - - - - - )} - - )} ) },