Skip to content

Commit 934da39

Browse files
committed
check for mountSpan before starting
1 parent ee2b204 commit 934da39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react/src/profiler.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Profiler extends React.Component<ProfilerProps> {
5555
}
5656

5757
const activeSpan = getActiveSpan();
58-
if (activeSpan) {
58+
if (activeSpan && !this._mountSpan) {
5959
this._mountSpan = startInactiveSpan({
6060
name: `<${name}>`,
6161
op: REACT_MOUNT_OP,
@@ -80,7 +80,7 @@ class Profiler extends React.Component<ProfilerProps> {
8080
// See what props haved changed between the previous props, and the current props. This is
8181
// set as data on the span. We just store the prop keys as the values could be potenially very large.
8282
const changedProps = Object.keys(updateProps).filter(k => updateProps[k] !== this.props.updateProps[k]);
83-
if (changedProps.length > 0) {
83+
if (changedProps.length > 0 && !this._updateSpan) {
8484
const now = timestampInSeconds();
8585
this._updateSpan = startInactiveSpan({
8686
name: `<${this.props.name}>`,

0 commit comments

Comments
 (0)