From 3c000a1133e32d037e2db2a926e74f18a64bb029 Mon Sep 17 00:00:00 2001 From: Hugo Knorr Date: Tue, 17 Dec 2024 15:28:31 +0100 Subject: [PATCH] fix: prevent priority and loading lazy incompatibility --- templates/website/src/components/Media/ImageMedia/index.tsx | 2 +- .../src/components/Media/ImageMedia/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/website/src/components/Media/ImageMedia/index.tsx b/templates/website/src/components/Media/ImageMedia/index.tsx index cb847ddbc25..bf2de6c8690 100644 --- a/templates/website/src/components/Media/ImageMedia/index.tsx +++ b/templates/website/src/components/Media/ImageMedia/index.tsx @@ -50,7 +50,7 @@ export const ImageMedia: React.FC = (props) => { src = `${getClientSideURL()}${url}` } - const loading = loadingFromProps || 'lazy' + const loading = loadingFromProps || (!priority ? 'lazy' : undefined) // NOTE: this is used by the browser to determine which image to download at different screen sizes const sizes = sizeFromProps diff --git a/templates/with-vercel-website/src/components/Media/ImageMedia/index.tsx b/templates/with-vercel-website/src/components/Media/ImageMedia/index.tsx index cb847ddbc25..bf2de6c8690 100644 --- a/templates/with-vercel-website/src/components/Media/ImageMedia/index.tsx +++ b/templates/with-vercel-website/src/components/Media/ImageMedia/index.tsx @@ -50,7 +50,7 @@ export const ImageMedia: React.FC = (props) => { src = `${getClientSideURL()}${url}` } - const loading = loadingFromProps || 'lazy' + const loading = loadingFromProps || (!priority ? 'lazy' : undefined) // NOTE: this is used by the browser to determine which image to download at different screen sizes const sizes = sizeFromProps