Skip to content

Commit

Permalink
fix(vx-voronoi): try fixing type
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Williams committed Oct 4, 2019
1 parent 45c9fb0 commit c70156c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vx-voronoi/src/components/VoronoiPolygon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ export type VoronoiPolygonProps = {
};

export default function VoronoiPolygon({
polygon,
polygon = [],
className,
children,
...restProps
}: VoronoiPolygonProps & Omit<React.SVGProps<SVGPathElement>, 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 })}</>;

Expand Down

0 comments on commit c70156c

Please sign in to comment.