Type Error: Property 'getStaticProps' is incompatible with index signature.
Unanswered
Siamese posted this in #help-forum
SiameseOP
Error
Property 'getStaticProps' is incompatible with index signature.
Type 'GetStaticProps' is not assignable to type 'never'.const Home: NextPage = ({ images }: { images: ImageProps[] }) => {
// ...
return <></>
}
export const getStaticProps: GetStaticProps = async () => {
// ...
return {
props: {
images: []
}
}
}4 Replies
@Siamese Error
bash
Property 'getStaticProps' is incompatible with index signature.
Type 'GetStaticProps' is not assignable to type 'never'.
typescript
const Home: NextPage = ({ images }: { images: ImageProps[] }) => {
// ...
return <></>
}
export const getStaticProps: GetStaticProps = async () => {
// ...
return {
props: {
images: []
}
}
}
you don't have getStaticProps in the app router
SiameseOP
what does it mean
in
/app you do not have getStaticPropsSiameseOP
ohh i see, the reference i was following uses
/pages. thanks!