@@ -6,6 +6,8 @@ import { timestampWithMs } from '@sentry/utils';
6
6
import hoistNonReactStatics from 'hoist-non-react-statics' ;
7
7
import * as React from 'react' ;
8
8
9
+ import { REACT_MOUNT_OP , REACT_OP , REACT_RENDER_OP , REACT_UPDATE_OP } from './constants' ;
10
+
9
11
export const UNKNOWN_COMPONENT = 'unknown' ;
10
12
11
13
const TRACING_GETTER = ( {
@@ -36,7 +38,7 @@ function pushActivity(name: string, op: string): number | null {
36
38
37
39
return ( globalTracingIntegration as any ) . constructor . pushActivity ( name , {
38
40
description : `<${ name } >` ,
39
- op : `react .${ op } ` ,
41
+ op : `${ REACT_OP } .${ op } ` ,
40
42
} ) ;
41
43
}
42
44
@@ -121,7 +123,7 @@ class Profiler extends React.Component<ProfilerProps> {
121
123
if ( activeTransaction ) {
122
124
this . _mountSpan = activeTransaction . startChild ( {
123
125
description : `<${ name } >` ,
124
- op : 'react.mount' ,
126
+ op : REACT_MOUNT_OP ,
125
127
} ) ;
126
128
}
127
129
}
@@ -158,7 +160,7 @@ class Profiler extends React.Component<ProfilerProps> {
158
160
} ,
159
161
description : `<${ this . props . name } >` ,
160
162
endTimestamp : now ,
161
- op : `react.update` ,
163
+ op : REACT_UPDATE_OP ,
162
164
startTimestamp : now ,
163
165
} ) ;
164
166
}
@@ -176,7 +178,7 @@ class Profiler extends React.Component<ProfilerProps> {
176
178
this . _mountSpan . startChild ( {
177
179
description : `<${ name } >` ,
178
180
endTimestamp : timestampWithMs ( ) ,
179
- op : `react.render` ,
181
+ op : REACT_RENDER_OP ,
180
182
startTimestamp : this . _mountSpan . endTimestamp ,
181
183
} ) ;
182
184
}
@@ -240,7 +242,7 @@ function useProfiler(
240
242
if ( activeTransaction ) {
241
243
return activeTransaction . startChild ( {
242
244
description : `<${ name } >` ,
243
- op : 'react.mount' ,
245
+ op : REACT_MOUNT_OP ,
244
246
} ) ;
245
247
}
246
248
@@ -257,7 +259,7 @@ function useProfiler(
257
259
mountSpan . startChild ( {
258
260
description : `<${ name } >` ,
259
261
endTimestamp : timestampWithMs ( ) ,
260
- op : `react.render` ,
262
+ op : REACT_RENDER_OP ,
261
263
startTimestamp : mountSpan . endTimestamp ,
262
264
} ) ;
263
265
}
0 commit comments