Skip to content

Commit 093107b

Browse files
committed
refactor(core): Update variable name from prev to report
1 parent 302ec04 commit 093107b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/core/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,14 @@ export const start = () => {
192192
}
193193

194194
if (render.name) {
195-
const prev = ReactScanInternals.reportData[render.name];
196-
prev.renders.push(render);
195+
const report = ReactScanInternals.reportData[render.name];
196+
if (report) {
197+
report.renders.push(render);
198+
}
197199
ReactScanInternals.reportData[render.name] = {
198-
count: (prev?.count ?? 0) + render.count,
199-
time: (prev?.time ?? 0) + render.time,
200-
renders: prev.renders,
200+
count: (report?.count ?? 0) + render.count,
201+
time: (report?.time ?? 0) + render.time,
202+
renders: report?.renders || [],
201203
};
202204
}
203205

0 commit comments

Comments
 (0)