Skip to content

Commit

Permalink
Fix multiple group trees when data changes (equinor#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilscb authored and Havard Bjerke committed Nov 29, 2021
1 parent 5a75b44 commit b230849
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ const GroupTreeViewer: React.FC = () => {
(state: GroupTreeState) => state.ui.currentFlowRate
);
useEffect(() => {
// Clear possible elements added from earlier updates.
const node = document.getElementById("grouptree_tree");
if (node) {
node.innerHTML = "";
}

renderer.current = new GroupTree(
"#grouptree_tree",
cloneDeep(data),
Expand Down

0 comments on commit b230849

Please sign in to comment.