Files
StevenandGitHub 191710ddfe Show error message when using legacy props on new next/image (#41930)
This PR shows a better error message when using legacy props on new
`next/image` (introduced in Next.js 13) and makes the codemod more
discoverable.
2022-10-27 12:17:28 -04:00

17 lines
413 B
JavaScript

import React from 'react'
import Image from 'next/image'
const Page = () => {
const [count, setCount] = React.useState(0)
return (
<>
<h1>Warning should print at most once</h1>
<Image id="w" src="/test.png" width="400" height="400" sizes="50vw" />
<button onClick={() => setCount(count + 1)}>Count: {count}</button>
<footer>footer here</footer>
</>
)
}
export default Page