File tree Expand file tree Collapse file tree
packages/react-devtools-shared/src/backend/fiber Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5831,13 +5831,21 @@ export function attach(
58315831 }
58325832
58335833 function getSourceForInstance ( instance : DevToolsInstance ) : Source | null {
5834- const unresolvedSource = instance . source ;
5834+ let unresolvedSource = instance . source ;
58355835 if ( unresolvedSource === null ) {
58365836 // We don't have any source yet. We can try again later in case an owned child mounts later.
58375837 // TODO: We won't have any information here if the child is filtered.
58385838 return null ;
58395839 }
58405840
5841+ if ( instance . kind === VIRTUAL_INSTANCE ) {
5842+ // We might have found one on the virtual instance.
5843+ const debugLocation = instance . data . debugLocation ;
5844+ if ( debugLocation != null ) {
5845+ unresolvedSource = debugLocation ;
5846+ }
5847+ }
5848+
58415849 // If we have the debug stack (the creation stack of the JSX) for any owned child of this
58425850 // component, then at the bottom of that stack will be a stack frame that is somewhere within
58435851 // the component's function body. Typically it would be the callsite of the JSX unless there's
You can’t perform that action at this time.
0 commit comments