mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix undefined chart node when switching commits in profiler
This commit is contained in:
@@ -123,9 +123,13 @@ function CommitFlamegraph({
|
||||
const selectedChartNode = useMemo(() => {
|
||||
let chartNode = null;
|
||||
if (selectedFiberID !== null) {
|
||||
chartNode = ((chartData.rows[selectedChartNodeIndex].find(
|
||||
const foundChartNode = chartData.rows[selectedChartNodeIndex].find(
|
||||
chartNode => chartNode.id === selectedFiberID
|
||||
): any): ChartNode);
|
||||
);
|
||||
|
||||
if (foundChartNode !== undefined) {
|
||||
chartNode = foundChartNode;
|
||||
}
|
||||
}
|
||||
return chartNode;
|
||||
}, [chartData, selectedFiberID, selectedChartNodeIndex]);
|
||||
|
||||
Reference in New Issue
Block a user