Just diving into my first typescript project and finding myself in need of some basic assistance...
My code seems to be running smoothly using npm run dev, but I encountered an error when trying to use npm run build.
Error: Binding element 'allImageData' implicitly has an 'any' type.
export default function Home({ allImageData }) {
^
Here's the snippet in question:
export async function getStaticProps() {
const allImageData: { id: string; fullpath: string }[] = getAllImages();
return {
props: {
allImageData,
},
};
}
export default function Home({ allImageData }) {
...
}
So, my query is around how to correctly assign types to props?