Skip to content

Commit

Permalink
fix(gatsby-plugin-image): Remove preload tag (#28998)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Jan 13, 2021
1 parent 5e5c112 commit 87bdec0
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions packages/gatsby-plugin-image/src/components/main-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,9 @@ import { Picture, PictureProps } from "./picture"
export type MainImageProps = PictureProps

export const MainImage = forwardRef<HTMLImageElement, MainImageProps>(
function MainImage({ ...props }, ref) {
function MainImage(props, ref) {
return (
<>
{props.loading === `eager` && (
<link
rel="preload"
as="image"
href={props.fallback.src}
// TODO: remove this if imagesrcset is added to the types
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
imagesrcset={props.fallback.srcSet}
imagesizes={props.fallback.sizes}
/>
)}
<Picture ref={ref} {...props} />
<noscript>
<Picture {...props} shouldLoad={true} />
Expand Down

0 comments on commit 87bdec0

Please sign in to comment.