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

Inflearn Community Q&A

notfoggy24198's profile image
notfoggy24198

asked

Node and React series that you can learn by following - Creating a Reddit site (NextJS) (Pages Router)

Putting user information in context (1)

context 질문 있습니다.

Written on

·

261

0

안녕하세요

export const AuthProvider = ({ children }: { children: React.ReactNode }) => {}

에서

({ children }: { children: React.ReactNode }) 질문입니다.

뒤에 타입 부분이 헷갈리는데, ({ children }: { children: React.ReactNode }) 하지 않고 ({ children }: React.Node} 이렇게 하면 왜 안되는건가요?

 

reactnode.jspostgresqldockertypescript클론코딩next.js

Answer 1

0

johnahn님의 프로필 이미지
johnahn
Instructor

안녕하세요!

이 부분은 객체 안에 children이라는 프로퍼티에게 React.ReactNode 타입을 지정하는 부분입니다.

({ children }: React.Node) => 이런 식으로 한다면 객체 전체의 타입이 React.Node라는 것이 됩니다!

감사합니다.

notfoggy24198's profile image
notfoggy24198

asked

Ask a question