인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

라푼젤's profile image
라푼젤

asked

Next + Create a SNS service with React Query

Load following posts, search results

팔로잉 게시글 TabContext에서 createContext매개변수 값 안넣어도 되나요?

Resolved

Written on

·

282

0

export const TabContext = createContext({
  tab: "recommend",
  setTab: (value: "recommend" | "following") => {},
});

{tab: "recommend", setTab:(value: "recommend" | "following") => {}} 부분을 제거하고 빈 createContext()만 생성해도 잘 동작하는거 같은데, 매개변수값은 무엇을하는건지 궁금합니다. 그냥 타입정의 한거라고 봐도될까요?

reactnext.jsreact-querynext-authmsw

Answer 1

1

zerocho님의 프로필 이미지
zerocho
Instructor

네 맞습니다. 타입 정의입니다.

라푼젤's profile image
라푼젤

asked

Ask a question