New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image layout prop does not exists in TS #18949
Comments
@styfle now I believe I found the real problem, when I use the Image Component with styled-components, the layout prop dos not shown up, any idea why? |
Does it work with the standard If so, then it sounds like a bug with |
It works with the default import, that solves the problem, thanks! |
Missing type variation in packages/next/client/image.tsx ? export declare type ImageProps = Omit<JSX.IntrinsicElements['img'], 'src' | 'srcSet' | 'ref' | 'width' | 'height' | 'loading' | 'style'> & {
src: string;
quality?: number | string;
priority?: boolean;
loading?: LoadingValue;
unoptimized?: boolean;
objectFit?: ImgElementStyle['objectFit'];
objectPosition?: ImgElementStyle['objectPosition'];
} & ({
width?: never;
height?: never;
/** @deprecated Use `layout="fill"` instead */
unsized: true;
} | {
width?: never;
height?: never;
layout: 'fill';
// BEGIN INSERT **************************************
quality?: number | string;
priority?: boolean;
loading?: LoadingValue;
unoptimized?: boolean;
objectFit?: ImgElementStyle['objectFit'];
objectPosition?: ImgElementStyle['objectPosition'];
// END INSERT*****************************************
} | {
width: number | string;
height: number | string;
layout?: Exclude<LayoutValue, 'fill'>; |
It's still a problem for me. I came up with a workaround by wrapping the parameters in parentheses. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
To Reproduce
Just have Next in a project, import
next/image
and try to use layout prop like so:Expected behavior
A working prop that is recognized by the editor.
Screenshots
System information
Additional context
The prop is working but its not recognized by the editor.
The text was updated successfully, but these errors were encountered: