Skip to content

Commit a52ece7

Browse files
authored
Remove prop-types (#1953)
* chore: remove prop-types from package dependencies * chore: remove babel-plugin-typescript-to-proptypes from dependencies * chore: update Tooltip component in README to use TypeScript types and remove PropTypes
1 parent b7eb5c9 commit a52ece7

File tree

33 files changed

+35
-141
lines changed

33 files changed

+35
-141
lines changed

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const presets = [
1616
'@babel/preset-typescript',
1717
];
1818

19-
const plugins = ['babel-plugin-typescript-to-proptypes'];
19+
const plugins = [];
2020

2121
const ignore = [
2222
'coverage/',

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
"@vitest/eslint-plugin": "^1.4.0",
8686
"@vitest/ui": "4",
8787
"airbnb-js-shims": "^2.2.1",
88-
"babel-plugin-typescript-to-proptypes": "^2.0.0",
8988
"chalk": "4.1.0",
9089
"eslint": "^8.57.0",
9190
"eslint-config-airbnb": "^19.0.4",

packages/visx-annotation/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"@visx/group": "3.13.0-alpha.0",
3737
"@visx/text": "3.13.2-alpha.0",
3838
"classnames": "^2.3.1",
39-
"prop-types": "^15.5.10",
4039
"react-use-measure": "^2.0.4"
4140
},
4241
"devDependencies": {

packages/visx-axis/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"@visx/scale": "3.12.0",
3535
"@visx/shape": "3.13.0-alpha.0",
3636
"@visx/text": "3.13.2-alpha.0",
37-
"classnames": "^2.3.1",
38-
"prop-types": "^15.6.0"
37+
"classnames": "^2.3.1"
3938
},
4039
"peerDependencies": {
4140
"react": "^16.3.0-0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0"

packages/visx-bounds/Readme.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,17 @@ _parent's_ bounding rect.
2121

2222
Example usage with a `<Tooltip />` component
2323

24-
```javascript
24+
```tsx
2525
import React from 'react';
26-
import PropTypes from 'prop-types';
27-
import { withBoundingRects, withBoundingRectsProps } from '@visx/bounds';
28-
29-
const propTypes = {
30-
...withBoundingRectsProps,
31-
left: PropTypes.number.isRequired,
32-
top: PropTypes.number.isRequired,
33-
children: PropTypes.node,
34-
};
26+
import { withBoundingRects, WithBoundingRectsProps } from '@visx/bounds';
3527

36-
const defaultProps = {
37-
children: null,
28+
type TooltipProps = WithBoundingRectsProps & {
29+
left: number;
30+
top: number;
31+
children?: React.ReactNode;
3832
};
3933

40-
function Tooltip({ left: initialLeft, top: initialTop, rect, parentRect, children }) {
34+
function Tooltip({ left: initialLeft, top: initialTop, rect, parentRect, children }: TooltipProps) {
4135
let left = initialLeft;
4236
let top = initialTop;
4337

@@ -49,8 +43,5 @@ function Tooltip({ left: initialLeft, top: initialTop, rect, parentRect, childre
4943
return <div style={{ top, left, ...myTheme }}>{children}</div>;
5044
}
5145

52-
Tooltip.propTypes = propTypes;
53-
Tooltip.defaultProps = defaultProps;
54-
5546
export default withBoundingRects(Tooltip);
5647
```

packages/visx-bounds/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
},
3232
"dependencies": {
3333
"@types/react": "*",
34-
"@types/react-dom": "*",
35-
"prop-types": "^15.5.10"
34+
"@types/react-dom": "*"
3635
},
3736
"peerDependencies": {
3837
"react": "^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0",

packages/visx-brush/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"@visx/group": "3.13.0-alpha.0",
3939
"@visx/scale": "3.12.0",
4040
"@visx/shape": "3.13.0-alpha.0",
41-
"classnames": "^2.3.1",
42-
"prop-types": "^15.6.1"
41+
"classnames": "^2.3.1"
4342
}
4443
}

packages/visx-chord/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
"@types/d3-chord": "^1.0.9",
3636
"@types/react": "*",
3737
"classnames": "^2.3.1",
38-
"d3-chord": "^1.0.4",
39-
"prop-types": "^15.6.1"
38+
"d3-chord": "^1.0.4"
4039
},
4140
"publishConfig": {
4241
"access": "public"

packages/visx-clip-path/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
},
3030
"homepage": "https://github.com/airbnb/visx#readme",
3131
"dependencies": {
32-
"@types/react": "*",
33-
"prop-types": "^15.5.10"
32+
"@types/react": "*"
3433
},
3534
"peerDependencies": {
3635
"react": "^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0"

packages/visx-delaunay/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"dependencies": {
3434
"@types/react": "*",
3535
"@visx/vendor": "3.12.0",
36-
"classnames": "^2.3.1",
37-
"prop-types": "^15.6.1"
36+
"classnames": "^2.3.1"
3837
},
3938
"peerDependencies": {
4039
"react": "^16.3.0-0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0"

0 commit comments

Comments
 (0)