10
10
import * as React from 'react' ;
11
11
import { Fragment , useContext } from 'react' ;
12
12
import { ProfilerContext } from './ProfilerContext' ;
13
- import { formatDuration , formatTime } from './utils' ;
13
+ import { formatDuration } from './utils' ;
14
14
import WhatChanged from './WhatChanged' ;
15
15
import { StoreContext } from '../context' ;
16
16
@@ -44,18 +44,17 @@ export default function HoveredFiberInfo({fiberData}: Props) {
44
44
for ( i = 0 ; i < commitIndices . length ; i ++ ) {
45
45
const commitIndex = commitIndices [ i ] ;
46
46
if ( selectedCommitIndex === commitIndex ) {
47
- const { duration, timestamp} = profilerStore . getCommitData (
48
- ( ( rootID : any ) : number ) ,
49
- commitIndex ,
50
- ) ;
47
+ const {
48
+ fiberActualDurations,
49
+ fiberSelfDurations,
50
+ } = profilerStore . getCommitData ( ( ( rootID : any ) : number ) , commitIndex ) ;
51
+ const actualDuration = fiberActualDurations . get ( id ) || 0 ;
52
+ const selfDuration = fiberSelfDurations . get ( id ) || 0 ;
51
53
52
54
renderDurationInfo = (
53
- < Fragment >
54
- < label className = { styles . Label } > Rendered at:</ label >
55
- < div key = { commitIndex } className = { styles . CurrentCommit } >
56
- { formatTime ( timestamp ) } s for { formatDuration ( duration ) } ms
57
- </ div >
58
- </ Fragment >
55
+ < div key = { commitIndex } className = { styles . CurrentCommit } >
56
+ { formatDuration ( selfDuration ) } ms of { formatDuration ( actualDuration ) } ms
57
+ </ div >
59
58
) ;
60
59
61
60
break ;
@@ -68,10 +67,10 @@ export default function HoveredFiberInfo({fiberData}: Props) {
68
67
< div className = { styles . Component } > { name } </ div >
69
68
</ div >
70
69
< div className = { styles . Content } >
71
- < WhatChanged fiberID = { ( ( id : any ) : number ) } />
72
70
{ renderDurationInfo || (
73
71
< div > Did not render during this profiling session.</ div >
74
72
) }
73
+ < WhatChanged fiberID = { ( ( id : any ) : number ) } />
75
74
</ div >
76
75
</ Fragment >
77
76
) ;
0 commit comments