Skip to content

Commit 83c8284

Browse files
committed
Cleaned up code and added typescript in PerformanceVisx.tsx
1 parent 85b225c commit 83c8284

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/components/PerformanceVisx.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import BarGraphComparisonActions from './BarGraphComparisonActions';
1616
import { useStoreContext } from '../store';
1717
import { setCurrentTabInApp } from '../actions/actions';
1818

19-
// typescript for PROPS from StateRoute.tsx
19+
2020
interface BarStackProps {
2121
width: number;
2222
height: number;
@@ -87,7 +87,7 @@ const traverse = (snapshot, data, snapshots, currTotalRender = 0) => {
8787
if (!snapshot.children[0]) return;
8888

8989
// loop through snapshots
90-
snapshot.children.forEach((child, idx) => {
90+
snapshot.children.forEach((child, idx: number) => {
9191
const componentName = child.name + -[idx + 1];
9292

9393
// Get component Rendering Time
@@ -152,7 +152,7 @@ const getPerfMetrics = (snapshots, snapshotsIds): {} => {
152152
componentData: {},
153153
maxTotalRender: 0,
154154
};
155-
snapshots.forEach((snapshot, i) => {
155+
snapshots.forEach((snapshot, i: number) => {
156156
perfData.barStack.push({ snapshotId: snapshotsIds[i], route: snapshot.route.url });
157157
traverse(snapshot, perfData, snapshots);
158158
});

0 commit comments

Comments
 (0)