강의

멘토링

커뮤니티

Inflearn Community Q&A

net6055788's profile image
net6055788

asked

Learning React A-Z by Following Along [Version 19 반영]

Fetching and displaying post data (remark)

getStaticProps typescript 선언

Written on

·

443

0

 

export const getStaticProps : GetStaticProps = async () => {
  const allPostsData = getSortedPostsData();
  return {
    props : {allPostsData}
  }
}

getStaticProps 뒤에 : GetStaticProps는 typescript 때문에 쓰는게 맞나요? 흔히 생각하는 typescript의 타입 (number, boolean 등등)은 아닌거 같은데 이것은 뭔가요??

Next.jstddtypescriptreduxreact

Answer 1

0

John Ahn님의 프로필 이미지
John Ahn
Instructor

안녕하세요! 

넵 타입 때문에 쓰는 게 맞습니다. 

저 안에 많은 타입들이 number, boolean 등으로 지정되어 있습니다 ~ 

오른쪽 클릭으로 Go to Definition 누르시면 타입을 보실 수 있습니다.

감사합니다.

net6055788's profile image
net6055788

asked

Ask a question