Skip to content

[Due for payment 2026-03-13] [Performance] Hide useCustomRootStackNavigatorState instead of removing it from the render tree #83950

Closed

Description

@mountiny

Coming from this proposal

Background:

The Inbox tab hosts the LHN — a list of reports that can span thousands of components in large accounts. On web, useCustomRootStackNavigatorState controls which screens stay in the render tree. It aggressively removes the previous screen when it is a full-screen navigator like Inbox. On iOS, the same hook keeps the previous screen mounted but hidden. Separately, usePreloadFullScreenNavigators fires after landing on a new tab and rebuilds adjacent tab navigators so switching feels instant.

These two systems operate independently — one tears down screens, the other rebuilds them. In practice, switching away from Inbox unmounts the entire LHN — every report row, every hook, every Onyx subscription. Then the preloader rebuilds it from scratch a second later. Both operations are extremely heavy, and together they spike the CPU to 100% for several seconds.

Problem:

When a user navigates from Inbox to any other tab on web, if the LHN contains a large number of reports, the CPU spikes to 100% for several seconds, causing the app to become unresponsive.

Solution:

Update the useCustomRootStackNavigatorState so the Inbox stays in the render tree (just hidden) on tab switch — the LHN is never torn down. Additionally, add a guard in usePreloadFullScreenNavigators that skips preloading when the navigator is already present in the routes — the LHN is never rebuilt from scratch.

Performance impact:

On heavy customer account with 5k items in the LHN, navigating away from Inbox on web caused 15-20s spike on the CPU. With these changes, navigating becomes almost instant, with CPU reaching 100% for <1s.

Draft PR: #83887

Issue OwnerCurrent Issue Owner: @TMisiukiewicz
Issue OwnerCurrent Issue Owner: @TMisiukiewicz

Activity

  1. added
    ReviewingHas a PR in review
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 3, 2026
  2. changed the title [-][Performance] Hide useCustomRootStackNavigatorState instead of removing it from the render tree[/-] [+][Due for payment 2026-03-13] [Performance] Hide useCustomRootStackNavigatorState instead of removing it from the render tree[/+] on Mar 6, 2026
  3. melvin-bot commented on Mar 6, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  4. melvin-bot commented on Mar 6, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.31-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-03-13. 🎊

    For reference, here are some details about the assignees on this issue:

  5. melvin-bot commented on Mar 6, 2026

    @melvin-bot

    Triggered auto assignment to @garrettmknight (Awaiting Payment)

  6. JS00001 commented on Mar 6, 2026

    @JS00001
    Contributor

    Closing since no external contributor was assigned (payments handled in another issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionTaskWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions