Next.js Discord

Discord Forum

Anything against not using Height or Width for next Image?

Unanswered
Reddish carpenter ant posted this in #help-forum
Open in Discord
Reddish carpenter antOP
Anything against of doing it the way its uncommented? Its for a banner.
<Image
            src={`${dataQuery?.data?.NewsArticle?.imageUrl}`}
            alt={`${dataQuery?.data?.NewsArticle?.imageCaption}`}
            // fill
            width={0}
            height={0}
            sizes="100vw"
            className="h-full w-full"
            priority
            // sizes="(max-width: 1268px) 100vw, 33vw"
            // width={`${dataQuery?.data?.NewsArticle?.imageWidth}`}
            // height={`${dataQuery?.data?.NewsArticle?.imageHeight}`}
            // priority='true'
            // style={{
            //   objectFit: 'contain'
            // }}
          />

0 Replies