Skip to content

Commit

Permalink
tweak condition
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Nov 30, 2021
1 parent ca39e38 commit fd2c120
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/next/client/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,12 @@ export default function Image({
}
}

let imageSrcSetPropName = 'imageSrcSet'
let imageSizesPropName = 'imageSizes'
if (!process.env.__NEXT_REACT_ROOT) {
imageSrcSetPropName = imageSrcSetPropName.toLowerCase()
imageSizesPropName = imageSizesPropName.toLowerCase()
}
const imageSrcSetPropName = process.env.__NEXT_REACT_ROOT
? 'imageSrcSet'
: 'imagesrcset'
const imageSizesPropName = process.env.__NEXT_REACT_ROOT
? 'imageSizes'
: 'imagesizes'
const linkProps = {
// Note: imagesrcset and imagesizes are not in the link element type with react 17.
[imageSrcSetPropName]: imgAttributes.srcSet,
Expand Down

0 comments on commit fd2c120

Please sign in to comment.