mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fixed a state cleanup issue if Profiler data is cleared
This commit is contained in:
@@ -153,12 +153,13 @@ export default class ProfilerStore extends EventEmitter {
|
||||
this._initialSnapshotsByRootID.clear();
|
||||
this._inProgressOperationsByRootID.clear();
|
||||
this._inProgressScreenshotsByRootID.clear();
|
||||
this._rendererQueue.clear();
|
||||
|
||||
// Invalidate suspense cache if profiling data is being (re-)recorded.
|
||||
// Note that we clear now because any existing data is "stale".
|
||||
this._cache.invalidate();
|
||||
|
||||
this.emit('isProfiling');
|
||||
this.emit('profilingData');
|
||||
}
|
||||
|
||||
startProfiling(): void {
|
||||
|
||||
@@ -63,20 +63,22 @@ function Profiler({ supportsProfiling }: Props) {
|
||||
}
|
||||
|
||||
let sidebar = null;
|
||||
switch (selectedTabID) {
|
||||
case 'interactions':
|
||||
sidebar = <SidebarInteractions />;
|
||||
break;
|
||||
case 'flame-chart':
|
||||
case 'ranked-chart':
|
||||
if (selectedFiberID !== null) {
|
||||
sidebar = <SidebarSelectedFiberInfo />;
|
||||
} else {
|
||||
sidebar = <SidebarCommitInfo />;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if (!isProfiling && !isProcessingData && hasProfilingData) {
|
||||
switch (selectedTabID) {
|
||||
case 'interactions':
|
||||
sidebar = <SidebarInteractions />;
|
||||
break;
|
||||
case 'flame-chart':
|
||||
case 'ranked-chart':
|
||||
if (selectedFiberID !== null) {
|
||||
sidebar = <SidebarSelectedFiberInfo />;
|
||||
} else {
|
||||
sidebar = <SidebarCommitInfo />;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user