Skip to content

Commit c59803d

Browse files
committed
fix: fix possible re-render loop in scenario manager tree
1 parent 1dccd4b commit c59803d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/charts/ScenarioManagerTreeList/ScenarioManagerTreeList.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ export const ScenarioManagerTreeList = (props) => {
104104
onScenarioUpdate = () => null,
105105
} = props;
106106

107-
const labels = { ...DEFAULT_LABELS, ...tmpLabels };
107+
const labels = useMemo(() => ({ ...DEFAULT_LABELS, ...tmpLabels }), [tmpLabels]);
108+
108109
if (buildSearchInfo) {
109110
console.warn(
110111
'"buildSearchInfo" prop is deprecated in ScenarioManagerTreeList. Please consider removing this prop.'

0 commit comments

Comments
 (0)