Skip to content

Commit

Permalink
typescript(vx-voronoi): fix test types, require react@16.3.0 peerDep
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Williams committed Oct 2, 2019
1 parent 38a068c commit d13f074
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/vx-voronoi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"prop-types": "^15.6.1"
},
"peerDependencies": {
"react": "^15.0.0-0 || ^16.0.0-0"
"react": "^16.3.0-0"
}
}
3 changes: 2 additions & 1 deletion packages/vx-voronoi/src/components/VoronoiPolygon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function VoronoiPolygon({
}: VoronoiPolygonProps & Omit<React.SVGProps<SVGPathElement>, keyof VoronoiPolygonProps>) {
if (!polygon) return null;
const path = `M${polygon.join('L')}Z`;
if (children) return children({ path, polygon });
if (children) return <>{children({ path, polygon })}</>;

return <path className={cx('vx-voronoi-polygon', className)} d={path} {...restProps} />;
}
4 changes: 1 addition & 3 deletions packages/vx-voronoi/test/VoronoiPolygon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { shallow } from 'enzyme';
import { VoronoiPolygon } from '../src';

describe('<VoronoiPolygon />', () => {
const data = [1, 2];
const polygon = new Array(3).fill(null).map((_, i) => [i, i]);
polygon.data = data;
const polygon: [number, number][] = new Array(3).fill(null).map((_, i) => [i, i]);

const props = { polygon };

Expand Down

0 comments on commit d13f074

Please sign in to comment.