diff --git a/packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.css b/packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.css index d50e36935f20c..3255b321d31fd 100644 --- a/packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.css +++ b/packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.css @@ -27,7 +27,7 @@ } .CurrentCommit { - margin-top: 0.25rem; + margin: 0.25rem 0; display: block; width: 100%; text-align: left; diff --git a/packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.js b/packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.js index fa07d02b1d7cd..78f6c5c6ae59b 100644 --- a/packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.js +++ b/packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.js @@ -10,7 +10,7 @@ import * as React from 'react'; import {Fragment, useContext} from 'react'; import {ProfilerContext} from './ProfilerContext'; -import {formatDuration, formatTime} from './utils'; +import {formatDuration} from './utils'; import WhatChanged from './WhatChanged'; import {StoreContext} from '../context'; @@ -44,18 +44,17 @@ export default function HoveredFiberInfo({fiberData}: Props) { for (i = 0; i < commitIndices.length; i++) { const commitIndex = commitIndices[i]; if (selectedCommitIndex === commitIndex) { - const {duration, timestamp} = profilerStore.getCommitData( - ((rootID: any): number), - commitIndex, - ); + const { + fiberActualDurations, + fiberSelfDurations, + } = profilerStore.getCommitData(((rootID: any): number), commitIndex); + const actualDuration = fiberActualDurations.get(id) || 0; + const selfDuration = fiberSelfDurations.get(id) || 0; renderDurationInfo = ( - - -
- {formatTime(timestamp)}s for {formatDuration(duration)}ms -
-
+
+ {formatDuration(selfDuration)}ms of {formatDuration(actualDuration)}ms +
); break; @@ -68,10 +67,10 @@ export default function HoveredFiberInfo({fiberData}: Props) {
{name}
- {renderDurationInfo || (
Did not render during this profiling session.
)} +
);