@@ -83,9 +83,9 @@ export type ProfilerProps = {
8383 // in certain environments.
8484 disabled ?: boolean ;
8585 // If time component is on page should be displayed as spans. True by default.
86- hasRenderSpan ?: boolean ;
86+ includeRender ?: boolean ;
8787 // If component updates should be displayed as spans. True by default.
88- hasUpdateSpan ?: boolean ;
88+ includeUpdates ?: boolean ;
8989 // props given to component being profiled.
9090 updateProps : { [ key : string ] : any } ;
9191} ;
@@ -104,8 +104,8 @@ class Profiler extends React.Component<ProfilerProps> {
104104
105105 public static defaultProps : Partial < ProfilerProps > = {
106106 disabled : false ,
107- hasRenderSpan : true ,
108- hasUpdateSpan : true ,
107+ includeRender : true ,
108+ includeUpdates : true ,
109109 } ;
110110
111111 public constructor ( props : ProfilerProps ) {
@@ -130,11 +130,11 @@ class Profiler extends React.Component<ProfilerProps> {
130130 this . mountActivity = null ;
131131 }
132132
133- public componentDidUpdate ( { updateProps, hasUpdateSpan = true } : ProfilerProps ) : void {
133+ public componentDidUpdate ( { updateProps, includeUpdates = true } : ProfilerProps ) : void {
134134 // Only generate an update span if hasUpdateSpan is true, if there is a valid mountSpan,
135135 // and if the updateProps have changed. It is ok to not do a deep equality check here as it is expensive.
136136 // We are just trying to give baseline clues for further investigation.
137- if ( hasUpdateSpan && this . mountSpan && updateProps !== this . props . updateProps ) {
137+ if ( includeUpdates && this . mountSpan && updateProps !== this . props . updateProps ) {
138138 // See what props haved changed between the previous props, and the current props. This is
139139 // set as data on the span. We just store the prop keys as the values could be potenially very large.
140140 const changedProps = Object . keys ( updateProps ) . filter ( k => updateProps [ k ] !== this . props . updateProps [ k ] ) ;
@@ -158,9 +158,9 @@ class Profiler extends React.Component<ProfilerProps> {
158158 // If a component is unmounted, we can say it is no longer on the screen.
159159 // This means we can finish the span representing the component render.
160160 public componentWillUnmount ( ) : void {
161- const { name, hasRenderSpan = true } = this . props ;
161+ const { name, includeRender = true } = this . props ;
162162
163- if ( this . mountSpan && hasRenderSpan ) {
163+ if ( this . mountSpan && includeRender ) {
164164 // If we were able to obtain the spanId of the mount activity, we should set the
165165 // next activity as a child to the component mount activity.
166166 this . mountSpan . startChild ( {
0 commit comments