Skip to content

Commit

Permalink
Filter react-* events only if they come from react-dom URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Jul 23, 2021
1 parent 275a2dd commit 16ca1fa
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,14 @@ function processTimelineEvent(
const type = args.data.type;

if (type.startsWith('react-')) {
// Filter out fake React events dispatched by invokeGuardedCallbackDev.
return;
const stackTrace = args.data.stackTrace;
if (stackTrace) {
const topFrame = stackTrace[stackTrace.length - 1];
if (topFrame.url.includes('node_modules/react-dom')) {
// Filter out fake React events dispatched by invokeGuardedCallbackDev.
return;
}
}
}

const startTime = (ts - currentProfilerData.startTime) / 1000;
Expand Down

0 comments on commit 16ca1fa

Please sign in to comment.