--- id: wiki-2026-0508-concurrent-rendering title: Concurrent Rendering category: 10_Wiki/Topics status: verified canonical_id: self aliases: [React Concurrent, Concurrent Mode, React 18 Concurrent] duplicate_of: none source_trust_level: A confidence_score: 0.9 verification_status: applied tags: [react, concurrent, rendering, scheduler, transitions] raw_sources: [] last_reinforced: 2026-05-10 github_commit: pending tech_stack: language: typescript framework: react --- # Concurrent Rendering ## 매 한 줄 > **"매 render 매 interruptible, prioritizable, abandonable"**. React 18 (2022) 에 stable. Fiber architecture (2017) 의 결실. 2026 현재 React 19+ 의 default; `useTransition`, `useDeferredValue`, Suspense, streaming SSR, React Compiler 매 모든 것 위에 빌드. ## 매 핵심 ### 매 핵심 idea - **Interruptible** — render 중 high-priority work (input, animation) 매 들어오면 yield. - **Concurrent (NOT parallel)** — single-threaded JS 위에서 cooperative scheduling. - **Time-slicing** — 5ms chunk 매 yield to browser (`scheduler` package). - **Multiple in-progress trees** — current + work-in-progress; double buffering. - **Lane-based priority** — sync, default, transition, idle lane. ### 매 hook / API - **`useTransition`** — non-urgent update (filter, navigation). - **`useDeferredValue`** — debounce-like, 매 lower priority value. - **`startTransition`** — imperative version. - **`Suspense`** — async boundary, fallback UI. - **`use` hook** (React 19) — read promise during render. ### 매 응용 1. Search-as-you-type — input 매 sync, list filter 매 transition. 2. Tab switching — 매 instant feel, 매 expensive subtree 의 background render. 3. SSR streaming — 매 progressive shell + island hydration. 4. Route navigation — `` prefetch + transition. ## 💻 패턴 ### useTransition — heavy filter ```tsx function Search() { const [query, setQuery] = useState(''); const [list, setList] = useState(allItems); const [isPending, startTransition] = useTransition(); return ( <> { setQuery(e.target.value); // urgent startTransition(() => { // non-urgent setList(allItems.filter(i => i.name.includes(e.target.value))); }); }} /> {isPending && } ); } ``` ### useDeferredValue ```tsx function Page({ query }: { query: string }) { const deferred = useDeferredValue(query); return ; } ``` ### Suspense + use (React 19+) ```tsx function UserProfile({ userPromise }: { userPromise: Promise }) { const user = use(userPromise); // suspends if pending return

{user.name}

; } }> ``` ### Streaming SSR (Next.js 15 / React 19) ```tsx // app/page.tsx export default async function Page() { return ( <>
}> {/* streamed once data ready */} ); } ``` ### React Compiler (2026, automatic memoization) ```tsx // no useMemo / useCallback needed — compiler inserts function Cart({ items }: { items: Item[] }) { const total = items.reduce((s, i) => s + i.price, 0); // auto-memoized return
{total}
; } ``` ### Selective hydration ```tsx // chat panel hydrates first if user clicks it, // even if header is still loading }>
}> ``` ### Cancel stale render (transition supersession) ```tsx // older transition automatically discarded when new one starts startTransition(() => setQuery('a')); // discarded startTransition(() => setQuery('ab')); // wins ``` ## 매 결정 기준 | 상황 | Approach | |---|---| | Input + heavy derived UI | `useTransition` | | External lib slow value | `useDeferredValue` | | Async data | `Suspense` + `use` | | SSR with slow data | streaming + Suspense islands | | Manual memoization (legacy) | replace with React Compiler | **기본값**: React 19+ with Compiler; transitions for any non-urgent update. ## 🔗 Graph - 부모: [[React]] · [[Rendering Pipeline]] - 변형: [[Fiber_Architecture|Fiber Architecture]] · [[Time_Slicing|Time Slicing]] - 응용: [[Streaming SSR]] - Adjacent: [[Virtual_DOM과_Reconciliation|Virtual DOM]] · [[Reconciliation]] · [[React Compiler]] ## 🤖 LLM 활용 **언제**: identify component 매 transition 으로 wrap 할 후보, code review 매 missed Suspense boundary. **언제 X**: scheduler internals 의 deep debug (need devtools profiler). ## ❌ 안티패턴 - **`startTransition` for urgent input**: input lag. - **No Suspense fallback**: 매 entire tree freeze 까지 falling back. - **Manual memoization with React Compiler**: redundant + sometimes 더 느림. - **Async setState in transition without race control**: stale data. - **Deferred value of huge object reference**: 매 GC pressure. ## 🧪 검증 / 중복 - Verified (React 18 release notes 2022, React 19 docs 2026, Acdlite/Sebastian Markbåge talks). - 신뢰도 A. ## 🕓 Changelog | 날짜 | 변경 | |---|---| | 2026-05-08 | Phase 1 | | 2026-05-10 | Manual cleanup — full content with React 19 + Compiler patterns |