getServerSideProps1 getStaticProps, getStaticPaths, getServerSideProps getStaticPropsstatic : 정적 사이트 생성, props : 컴포넌트의 인풋getStaticProps는 빌드 시 데이터를 패치하는 함수Next.js 코드에 getStaticProps 가 있다면 Next.js가 빌드시 알아서 함수를 실행하고, 그 props를 컴포넌트에 전달한다. 사용예제function BlogPost({ post }) { return ( {post.title} {post.content} )}export async function getStaticProps() { const res = await fetch('https://.../posts/1') const post = await res.json() return { prop.. 2024. 7. 16. 이전 1 다음