nextjs lib1 Data Fetching - getStaticProps 페이지에서 getStaticProps 함수를 내보내면 반환된 props를 사용해 빌드시 페이지를 미리 렌더링한다. export async function getStaticProps(context) { return { props: {}, // will be passed to the page component as props } } When should I use getStaticProps? 페이지를 렌더링하는데 필요한 데이터가 사용자 요청보다 앞서 빌드되어야할 때 The data comes from a headless CMS The page must be pre-rendered (for SEO) and be very fast — getStaticProps generates HTML and JSON file.. 2022. 12. 29. 이전 1 다음 728x90