본문 바로가기

TIL

[React 까보기 시리즈] Virtual DOM 의 맨 위에는 어떤 node 가 있을까? root node 까보기(feat. CRA)

https://www.youtube.com/watch?v=3B5XcKkU4ug

root node 안에는 어떤 Property들이 들어있을까? (feat. VDOM) 

생성 방법 : root node는 FiberRootNode로 생성 

 

구성요소 

- containerInfo : container element(div) 

- expirationTimes : scheduler에서 처리하는 우선순위 관련 값 

- current : VDOM 최상단 nodes(host root) 

      - return : null 최상단이기 때문에 

      - stateNode : FiberRootNode 가르킴 (자신을 렌더한 container를 stateNode를 통해 가리킴) DOM에 마운트 되는 얘들만 가리키는게 stateNode이기 때문에 개발자가 작성한 커스텀 컴포넌트의 stateNode는 null임.