Skip to content

Commit 221ad4c

Browse files
Stop chart from rendering before parent is ready
1 parent 2a3529a commit 221ad4c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/src/app/components/sidebar/PopulationPanel/PopulationChart/PopulationChart.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ export const PopulationChart: React.FC<{
6565
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
6666
const [isHovered, setIsHovered] = useState(false);
6767

68+
// Parnent container not ready yet
69+
if (xMax < 0) {
70+
return null;
71+
}
72+
6873
return (
6974
<svg
7075
width={width}

0 commit comments

Comments
 (0)