[react] Function As Child Component

dev stefanCho·2021년 7월 17일
0

react

목록 보기
8/19

Children 으로 callback function을 넣는 방식이다.

설명

Children Component에서 모든 render을 해도 되지만, 복잡해질수록 Children Component에 많은 load가 실린다. 이런경우 Parent Component에서 callback에서 render되는 형태를 처리해주면 좋다.

실제 사용 예

React-Final-Form > Step4를 보면, children이 callback function이다.

Ref

Function as Child Components Are an Anti-Pattern

profile
Front-end Developer

0개의 댓글