Next.js Discord

Discord Forum

Outputting images without knowing width/height

Unanswered
Little Stint posted this in #help-forum
Open in Discord
Little StintOP
Is there a way to output an image with it's default width and height (of that image without setting any width or height and not knowing the width/height beforehand)? So literally just outputting the image with it's original width/height properties.

<Image
  key={j}
  src="test.png"
  width={?} // don't want to set 
  height={?} // don't want to set
  alt="test_image"
  style={{ width: '100%', height: 'auto' }}
/>


Thanks!

1 Reply

Sun bear