children1 children props는 값을 내려주는 건데, 칠드런은 뭐하는 놈인가..props만 있으면 되는거 아닌가? 라고 생각을 했다. 말그대로 자식이라 생각하면 편하다. app.tsx내에서 , props는 내려주면 이렇게 썼다. children은 (자식) 이 사이에 있는 자식이 ! (자식) = 어떤 것이던 다 해당 컴포넌트로 내려준다는 거다. 예제를 보겠다.//Container.tsx (Children 컴포넌트)import { ReactNode } from "react";interface TChildren { children: ReactNode; id: string;}export default function Container({ children, id }: TChildren) { return ( .. 2024. 7. 23. 이전 1 다음