()
| 103 | // If a component is unmounted, we can say it is no longer on the screen. |
| 104 | // This means we can finish the span representing the component render. |
| 105 | public componentWillUnmount(): void { |
| 106 | const endTimestamp = timestampInSeconds(); |
| 107 | const { name, includeRender = true } = this.props; |
| 108 | |
| 109 | if (this._mountSpan && includeRender) { |
| 110 | const startTime = spanToJSON(this._mountSpan).timestamp; |
| 111 | withActiveSpan(this._mountSpan, () => { |
| 112 | const renderSpan = startInactiveSpan({ |
| 113 | onlyIfParent: true, |
| 114 | name: `<${name}>`, |
| 115 | op: REACT_RENDER_OP, |
| 116 | startTime, |
| 117 | attributes: { |
| 118 | [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', |
| 119 | 'ui.component_name': name, |
| 120 | }, |
| 121 | }); |
| 122 | if (renderSpan) { |
| 123 | // Have to cast to Span because the type of _mountSpan is Span | undefined |
| 124 | // and not getting narrowed properly |
| 125 | renderSpan.end(endTimestamp); |
| 126 | } |
| 127 | }); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | public render(): React.ReactNode { |
| 132 | return this.props.children; |
nothing calls this directly
no test coverage detected