From c70156c4a22f10ce4eb8bc844475c8d9760530a9 Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Fri, 4 Oct 2019 13:05:24 -0700 Subject: [PATCH] fix(vx-voronoi): try fixing type --- packages/vx-voronoi/src/components/VoronoiPolygon.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/vx-voronoi/src/components/VoronoiPolygon.tsx b/packages/vx-voronoi/src/components/VoronoiPolygon.tsx index 6a8793e50d..45478a9861 100644 --- a/packages/vx-voronoi/src/components/VoronoiPolygon.tsx +++ b/packages/vx-voronoi/src/components/VoronoiPolygon.tsx @@ -11,12 +11,13 @@ export type VoronoiPolygonProps = { }; export default function VoronoiPolygon({ - polygon, + polygon = [], className, children, ...restProps }: VoronoiPolygonProps & Omit, keyof VoronoiPolygonProps>) { - if (!polygon) return null; + if (polygon.length === 0) return null; + const path = `M${polygon.join('L')}Z`; if (children) return <>{children({ path, polygon })};