Skip to content

Commit 4409be8

Browse files
author
Brian Vaughn
committed
Filter react-* events only if they come from react-dom URL
1 parent d49811c commit 4409be8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/react-devtools-scheduling-profiler/src/import-worker/preprocessData.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,14 @@ function processTimelineEvent(
168168
const type = args.data.type;
169169

170170
if (type.startsWith('react-')) {
171-
// Filter out fake React events dispatched by invokeGuardedCallbackDev.
172-
return;
171+
const stackTrace = args.data.stackTrace;
172+
if (stackTrace) {
173+
const topFrame = stackTrace[stackTrace.length - 1];
174+
if (topFrame.url.includes('node_modules/react-dom')) {
175+
// Filter out fake React events dispatched by invokeGuardedCallbackDev.
176+
return;
177+
}
178+
}
173179
}
174180

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

0 commit comments

Comments
 (0)