Using NextImage but without width
, height
and fill
props.
Last active
September 10, 2022 10:38
-
-
Save nekochan0122/d5bafcc94a0a830ec7cc6157abefbcd9 to your computer and use it in GitHub Desktop.
NextImage Infinity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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