Skip to content

Commit

Permalink
fix: prevent priority and loading lazy incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
hkn-wt committed Dec 17, 2024
1 parent 29ad1fc commit 3c000a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const ImageMedia: React.FC<MediaProps> = (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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const ImageMedia: React.FC<MediaProps> = (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
Expand Down

0 comments on commit 3c000a1

Please sign in to comment.