Skip to content

Add React DevTools Suspense panel - #290

Merged
huntie merged 1 commit into
mainfrom
react-devtools-suspense-panel
Nov 10, 2026
Merged

huntie merged 1 commit into
mainfrom
react-devtools-suspense-panel

Conversation

@huntie

@huntie huntie commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add a "Suspense ⚛" panel which renders the React DevTools Suspense tab: Suspense boundaries as a minimap and reveal timeline, plus what each boundary suspended on.

Notes

  • The minimap and timeline place a boundary by the rects of its host nodes. On React Native, the backend can only measure a host node once its public instance exists, such as after a ref attaches, so a boundary around plain <View> and <Text> content is left out. The tree and the inspector are unaffected; the fix belongs in the React DevTools backend.

Test Plan

Repeat all verification from #289, then:

A temporary RNTester Playground screen, not part of this PR, nests named Suspense boundaries that resolve after 0.5 s, 2 s, 3.5 s (a React.lazy component) and 4.5 s, plus one that never resolves. Each card has a ref, per the note above.

iPhone 18 Pro: loading
iPhone 18 Pro: resolvedSuspense panelBoundary selected
Temporary Suspense demo in Playground tab

✅ Suspense ⚛ appears after Profiler ⚛ and opens directly with panel=react-devtools-suspense.
✅ The boundary map and reveal timeline show Page, Feed, Comments and Sidebar in reveal order; the Ads boundary stays suspended.
✅ Selecting Comments shows it suspended on lazy, with its props and owner stack.

Test screen
function SuspenseDemo(): React.Node {
  return (
    <Suspense name="Page" fallback={<Fallback title="Page" />}>
      <DataCard title="Header" color="#bfdbfe" delay={500} />
      <Suspense name="Feed" fallback={<Fallback title="Feed" />}>
        <DataCard title="Feed" color="#bbf7d0" delay={2000} />
        <Suspense name="Comments" fallback={<Fallback title="Comments" />}>
          <LazyComments />
        </Suspense>
      </Suspense>
      <Suspense name="Sidebar" fallback={<Fallback title="Sidebar" />}>
        <DataCard title="Sidebar" color="#fbcfe8" delay={4500} />
      </Suspense>
      <Suspense name="Ads" fallback={<Fallback title="Ads (never loads)" />}>
        <DataCard title="Ads" color="#e5e7eb" delay={1e9} />
      </Suspense>
    </Suspense>
  );
}

@huntie
huntie force-pushed the react-devtools-suspense-panel branch from c244651 to fe138e7 Compare November 9, 2026 20:42
@huntie
huntie requested a review from motiz88 November 9, 2026 20:44
@vzaidman

Copy link
Copy Markdown

the fix belongs in the React DevTools backend?

Could you elaborate? Who works on that? Is it worth shipping if that's the case?

@huntie
huntie merged commit a16b8c8 into main Nov 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants