(JSX attribute) layout: string
No overload matches this call.
Just have Next in a project, import next/image
and try to use layout prop like so:
<Background src='/img/header.png' quality={100} layout='fill' />
A working prop that is recognized by the editor.
{
"dependencies": {
"next": "10.0.2-canary.4"
}
}
The prop is working but its not recognized by the editor.
You're example says Background
instead of Image
. Perhaps you are using the wrong component.
I confirmed that layout="fill"
does work correctly with TS and it even offers the suggestion.
Make sure you use import Image from 'next/image'
to import the correct component.
@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 import Image from 'next/image'
usage?
If so, then it sounds like a bug with styled-components
.
It works with the default import, that solves the problem, thanks!
Most helpful comment
Does it work with the standard
import Image from 'next/image'
usage?If so, then it sounds like a bug with
styled-components
.