File tree 2 files changed +4
-7
lines changed
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,8 @@ export const generateUseBeacon =
61
61
62
62
traceManager . processSpan ( renderStartTaskEntry )
63
63
64
- // React's concurrent rendering might pause and discard a render,
65
- // which would mean that an effect scheduled for that render does not execute because the render itself was not committed to the DOM.
66
- // we want to store the first time that the render was scheduled as the start time of rendering
67
64
const renderStartRef = useRef < Timestamp | undefined > ( )
68
- if ( ! renderStartRef . current ) {
69
- renderStartRef . current = renderStartTaskEntry . startTime
70
- }
65
+ renderStartRef . current = renderStartTaskEntry . startTime
71
66
72
67
// Beacon effect for tracking 'component-render'. This will fire after every render as it does not have any dependencies:
73
68
useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -229,7 +229,9 @@ function getComputedRenderBeaconSpans<
229
229
230
230
if ( entry . span . type === 'component-render' ) {
231
231
spanTimes . renderCount += 1
232
- // If there was a pending render start, include the time from that start to this render
232
+ // React's concurrent rendering might pause and discard a render,
233
+ // which would mean that an effect scheduled for that render does not execute because the render itself was not committed to the DOM.
234
+ // we want to extend the the render span backwards, to first time that rendering was scheduled as the start time of rendering
233
235
if ( spanTimes . lastRenderStartTime !== undefined ) {
234
236
spanTimes . sumOfDurations +=
235
237
start + duration - spanTimes . lastRenderStartTime
You can’t perform that action at this time.
0 commit comments