Niels-IO / next-image-export-optimizer

Use Next.js advanced <Image/> component with the static export functionality. Optimizes all static images in an additional step after the Next.js static export.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Images that dont have predefined height

joebentaylor1995 opened this issue · comments

What props to do you use if your image has a rough width estimate, responsively, but needs to be auto in height?

Cant use fill, as that fills the parent div, cant use set height as that will change responsively...

Hi @joebentaylor1995,

would this work? https://nextjs.org/docs/pages/api-reference/components/image#responsive-image-with-aspect-ratio

Otherwise, can you wrap it with another div with your appropriate dimensioning so that you can use fill? (as that is the intended approach by Next.js)

GatsbyJS image worked perfectly for this scenario

How would you define the Next.js image component in a normal next.js application?

I think the best bet would be to wrap your image in another div and use the Next.js image component as it is intended.

The fact this is closed is such a poor way to deal with a request.