Skip to content

Instantly share code, notes, and snippets.

@nekochan0122
Last active September 10, 2022 10:38
Show Gist options
  • Save nekochan0122/d5bafcc94a0a830ec7cc6157abefbcd9 to your computer and use it in GitHub Desktop.
Save nekochan0122/d5bafcc94a0a830ec7cc6157abefbcd9 to your computer and use it in GitHub Desktop.
NextImage Infinity

NextImage - Infinity

Using NextImage but without width, height and fill props.

import React from 'react'
import NextImage from 'next/future/image'
import type { ImageProps } from 'next/future/image'
function NextImageInfinity({ width, height, draggable, ...rest }: ImageProps) {
return (
<NextImage
width={width ?? Infinity}
height={height ?? Infinity}
draggable={draggable ?? false}
{...rest}
/>
)
}
export default NextImageInfinity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment