Windowed memory
Cap how many tabs stay mounted — 60 tabs, only 3 live.
windowConfig={{ ahead, behind }} lazy defers a tab’s first mount, but once visited it stays mounted — fine for a handful of tabs, costly for dozens of media-heavy lists. windowConfig caps it: only the focused tab plus `behind` left and `ahead` right stay live; the rest tear down their native views (the bulk of the memory — list cells, decoded images) while keeping React state and scroll position for instant restore.
<Tabs.Container windowConfig={{ ahead: 1, behind: 1 }}>
{tabs}
</Tabs.Container>
// 60 tabs, but only the focused one ±1 stay mountedUse ahead / behind ≥ 1 so the swipe target is already live before the gesture finishes. The window is recomputed when a tab switch settles (not per frame), and it composes with lazy.
Note · <Activity> is stable in React 19.2+. On older React the prop is ignored with a one-time dev warning (every visited tab stays mounted, as before) — so it’s safe to set unconditionally.
Reference
windowConfig { ahead: number; behind: number } Keep only the focused tab plus `behind` tabs left and `ahead` right mounted; the rest hide via React’s <Activity mode="hidden">, freeing native views while keeping React state and scroll position. Needs React 19.2+.