Easy
Examine the following code for a blog page in Next.js:
// pages/blog/[slug].js
export async function getStaticProps({ params }) {
const postData = getBlogPostBySlug(params.slug);
return { props: { postData } };
}
export default function BlogPost({ postData }) {
return <article>{postData.content}</article>;
}
What does the getStaticProps function do in this context?
Author: AnasStatus: PublishedQuestion passed 47 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
Similar QuestionsMore questions about Next JS