mason
mason-log.

mason

mason.

안녕하세요. mason 입니다.

react

React Fiber.

Fiber 아키텍처, work loop, concurrent rendering, priority 개념

Fiber는 React 16+의 재조정(reconciliation) 단위이자, 작업을 잘게 쪼개 우선순위와 중단/재개를 가능하게 하는 자료구조입니다.

🧵 Fiber가 해결한 것

  • 이전 Stack reconciler: 동기, non-interruptible — 큰 트리 업데이트 시 프레임 drop
  • Fiber: work unit마다 linked list로 연결, requestIdleCallback/MessageChannel 기반 스케줄링

🧵 Fiber 노드 (개념)

Fiber child sibling return 링크 구조

  • type, key, stateNode (DOM/instance)
  • child, sibling, return — 트리 + linked list
  • alternate — current ↔ workInProgress (double buffering)
  • flags — Placement, Update, Deletion 등

⏱️ Concurrent Features

  • Time Slicing: render를 프레임 단위로 나눔
  • Suspense: async UI, fallback
  • Transitions (startTransition): urgent vs non-urgent update 분리
  • useDeferredValue

🔗 참고 자료

  • Render and Commit — Fiber 기반 렌더/커밋 흐름을 설명한다.
  • startTransition — urgent와 non-urgent update를 분리하는 API다.
  • useDeferredValue — 긴급하지 않은 값의 지연 업데이트를 설명한다.
  • React 18 — Concurrent Features와 스케줄링 변경을 소개한다.