Open vitormarquesds opened 1 year ago
Hi I found a solution instead of this :
export default function Home({ posts }) {
do this
export default function Home({ posts } : any ) {
its to do with typescript. it always needs a definition type for every parameter
I think the issue is in getStaticProps() function. It should be setting "posts" as a const and then point props to posts. Please see below.
export async function getStaticProps() {
const posts = (await getPosts()) || [];
return {
props: { posts }
}
}
I'm having an error in the post. I do not know if this is the version, but I didn't find a solution