dillon1000/react
Commit
Browse files [DevTools] If the await doesn't have a stack use the stack from use() if any (#34162)
Stacked on #34148. This picks up the stack for the await from the `use()` Hook if one was used to get this async info. When you select a component that used hooks, we already collect this information. If you select a Suspense boundary, this lazily invokes the first component that awaited this data to inspects its hooks and produce a stack trace for the use(). When all we have for the name is "Promise" I also use the name of the first callsite in the stack trace if there's more than one. Which in practice will be the name of the custom Hook that called it. Ideally we'd use source mapping and ignore listing for this but that would require suspending the display. We could maybe make the SuspendedByRow wrapped in a Suspense boundary for this case. <img width="438" height="401" alt="Screenshot 2025-08-10 at 10 07 55 PM" src="https://github.com/user-attachments/assets/2a68917d-c27b-4c00-84aa-0ceb51c4e541" />
Changed paths2 files
First-parent comparisonpackages/react-devtools-shared/src/backend/fiber/renderer.js ModifiedM packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…