next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Update docs for `next/future/image` migration guide

Open styfle opened this issue 1 year ago • 5 comments

Follow up to #39270 to make the props collapse to newlines

styfle avatar Aug 04 '22 00:08 styfle

I'm not sure this would be the issue of how they're displayed on mobile, though. Should we try removing the table instead?

leerob avatar Aug 04 '22 03:08 leerob

@leerob Do you like sections from the original #39270 commit better?

See Rendered Markdown →

styfle avatar Aug 06 '22 02:08 styfle

I would suggest doing it like this:

Responsive

// next/image: <ImageLegacy src={src} layout="responsive" />
// next/image/future: Use `sizes` and `style` for the same behavior

<ImageFuture
  src={src}
  sizes="100vw"
  style={{ width: '100%', height: 'auto' }}
/>

leerob avatar Aug 06 '22 20:08 leerob

@leerob are you suggesting using comments so the legacy code isn’t highlighted?

styfle avatar Aug 08 '22 03:08 styfle

Correct - my thought is you're going here because you want to copy-paste the new version, so the code comment gives you the only one to reference.

leerob avatar Aug 09 '22 03:08 leerob

Closing in favor of #39421

styfle avatar Aug 10 '22 20:08 styfle