post-thumbnail

[Next] getStaticProps vs getServerSideProps

📋 getStaticProps vs getServerSideProps getStaticProps와 getServerSideProps는 모두 사전 렌더링이 필요할 때 사용하는 Next.js 내장 기능이다. 그렇다면 이 둘이 정확히 무엇인지, 또 어떤 차이가 있는지 알아보자. 📌 1. getStaticProps > If you export a function called getStaticProps (Static Site Generation) from a page, Next.js will pre-render this page at build time using the props returned by getStaticProps. -Next.js 공식 문서 getStaticProps는 빌드할 때 딱 한 번만 실행되는 정적 사이트 생성(Static Site Generation) 함수이다. 다시 빌드를 하지 않는다면

2023년 4월 15일
·
0개의 댓글
·