This is an issue I had when converting a NextJS project to TypeScript. In my _app.tsx
, I got a type error: Binding element 'pageProps' implicitly has an 'any' type. ts(7031)
. The error likely looks like this:
I know that there are existing answers for this somewhere on StackOverflow, but I am writing this so that someone in the future might come across this easier.
import { AppProps } from 'next/app'; export default function ItemsGrid({ items }: AppProps) { return <ul> {items.map(item => <li key={item.id}> <h1>{item.name}</h1> </li>)} </ul> }
but I still get this message/warning:Property 'items' does not exist on type 'AppProps'.ts(2339) (parameter) items: any
– Upper