From f7661daa617c6ce34554ae39d0f4ae238f50a21a Mon Sep 17 00:00:00 2001 From: anajavi Date: Mon, 4 Apr 2022 10:38:19 +0300 Subject: [PATCH] Remove prop-types (#354) --- .eslintrc | 2 +- README.md | 2 +- babel.config.js | 3 - package-lock.json | 113 +++++++++--------- package.json | 2 - packages/react-jsx-highcharts/README.md | 2 +- packages/react-jsx-highcharts/package.json | 3 +- .../src/components/Annotation/Annotation.js | 5 - .../src/components/Axis/Axis.js | 9 -- .../src/components/BarSeries/BarSeries.js | 5 +- .../src/components/BaseChart/BaseChart.js | 7 -- .../src/components/Chart/Chart.js | 15 --- .../src/components/Credits/Credits.js | 5 - .../src/components/Debug/Debug.js | 5 - .../HighchartsSparkline.js | 11 -- .../src/components/Legend/Legend.js | 4 - .../src/components/Loading/Loading.js | 9 -- .../src/components/Options3d/Options3d.js | 11 -- .../src/components/PlotBandLine/PlotBand.js | 9 -- .../src/components/PlotBandLine/PlotLine.js | 8 -- .../src/components/Series/Series.js | 20 +--- .../src/components/Tooltip/Tooltip.js | 5 - .../src/components/WithSeriesType/index.js | 12 +- .../src/components/YAxis/YAxis.js | 4 - .../src/components/ZAxis/ZAxis.js | 4 - packages/react-jsx-highcharts/src/index.js | 8 +- .../src/utils/propTypeValidators.js | 10 -- .../components/WithSeriesType/index.spec.js | 15 --- packages/react-jsx-highmaps/README.md | 2 +- packages/react-jsx-highmaps/package.json | 1 - .../components/MapNavigation/MapNavigation.js | 5 - .../MapNavigation/MapNavigationButton.js | 5 - packages/react-jsx-highstock/README.md | 2 +- packages/react-jsx-highstock/package.json | 1 - .../src/components/Navigator/Navigator.js | 5 - .../src/components/Navigator/NavigatorAxis.js | 4 - .../components/Navigator/NavigatorSeries.js | 4 - .../components/RangeSelector/RangeSelector.js | 5 - .../RangeSelector/RangeSelectorButton.js | 19 --- .../RangeSelector/RangeSelectorInput.js | 6 - .../src/components/Scrollbar/Scrollbar.js | 5 - 41 files changed, 67 insertions(+), 305 deletions(-) delete mode 100644 packages/react-jsx-highcharts/src/utils/propTypeValidators.js diff --git a/.eslintrc b/.eslintrc index 4e6216ba..eda342c2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -27,7 +27,7 @@ ], "rules": { "no-unused-vars": ["error", { "ignoreRestSiblings": true }], - "react/prop-types": "warn", + "react/prop-types": "off", "prefer-object-spread": "warn", "react-hooks/rules-of-hooks": "error", "react/jsx-no-constructed-context-values": "error" diff --git a/README.md b/README.md index e2ef0c88..ed07a043 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ npm install --save react-jsx-highcharts # or react-jsx-highmaps # And the peer dependencies -npm install --save react react-dom prop-types highcharts@^9.0.0 +npm install --save react react-dom highcharts@^9.0.0 ``` ## Licensing diff --git a/babel.config.js b/babel.config.js index 54201d6d..ef811a7a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -15,8 +15,5 @@ let config = { '@babel/react' ] }; -if (ENV !== 'test') { - config.plugins.push('transform-react-remove-prop-types'); -} module.exports = config; diff --git a/package-lock.json b/package-lock.json index df41eba5..02067d81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@testing-library/react": "^13.0.0", "@types/react": "^17.0.40", "babel-loader": "^8.2.3", - "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "cross-env": "^7.0.3", "eslint": "^8.11.0", "eslint-config-prettier": "^8.5.0", @@ -27,7 +26,6 @@ "highcharts": "^10.0.0", "jest": "^27.5.1", "prettier": "^2.6.0", - "prop-types": "^15.8.1", "react": "^18.0.0", "react-dom": "^18.0.0", "react-test-renderer": "^18.0.0", @@ -3663,12 +3661,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/babel-plugin-transform-react-remove-prop-types": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz", - "integrity": "sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==", - "dev": true - }, "node_modules/babel-preset-current-node-syntax": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", @@ -3837,9 +3829,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001323", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001323.tgz", - "integrity": "sha512-e4BF2RlCVELKx8+RmklSEIVub1TWrmdhvA5kEUueummz1XyySW0DVk+3x9HyhU9MuWTa2BhqLgEuEmUwASAdCA==", + "version": "1.0.30001325", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz", + "integrity": "sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ==", "dev": true, "funding": [ { @@ -5725,9 +5717,9 @@ } }, "node_modules/is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" @@ -5774,10 +5766,13 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7812,12 +7807,12 @@ } }, "node_modules/jsx-ast-utils": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz", - "integrity": "sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.2.tgz", + "integrity": "sha512-HDAyJ4MNQBboGpUnHAVUNJs6X0lh058s6FuixsFGP7MgJYpD6Vasd6nzSG5iIfXu1zAYlHJ/zsOKNlrenTUBnw==", "dev": true, "dependencies": { - "array-includes": "^3.1.3", + "array-includes": "^3.1.4", "object.assign": "^4.1.2" }, "engines": { @@ -8115,6 +8110,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -8487,9 +8483,9 @@ } }, "node_modules/prettier": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz", - "integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -8556,6 +8552,7 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -8565,7 +8562,8 @@ "node_modules/prop-types/node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true }, "node_modules/psl": { "version": "1.8.0", @@ -9692,9 +9690,9 @@ } }, "node_modules/webpack": { - "version": "5.70.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.70.0.tgz", - "integrity": "sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==", + "version": "5.71.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.71.0.tgz", + "integrity": "sha512-g4dFT7CFG8LY0iU5G8nBL6VlkT21Z7dcYDpJAEJV5Q1WLb9UwnFbrem1k7K52ILqEmomN7pnzWFxxE6SlDY56A==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -10057,7 +10055,6 @@ }, "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0 || ^10.0.0", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0" } @@ -10071,7 +10068,6 @@ }, "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0 || ^10.0.0", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0" } @@ -10085,7 +10081,6 @@ }, "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0 || ^10.0.0", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0" } @@ -12783,12 +12778,6 @@ "@babel/helper-define-polyfill-provider": "^0.3.1" } }, - "babel-plugin-transform-react-remove-prop-types": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz", - "integrity": "sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==", - "dev": true - }, "babel-preset-current-node-syntax": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", @@ -12914,9 +12903,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001323", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001323.tgz", - "integrity": "sha512-e4BF2RlCVELKx8+RmklSEIVub1TWrmdhvA5kEUueummz1XyySW0DVk+3x9HyhU9MuWTa2BhqLgEuEmUwASAdCA==", + "version": "1.0.30001325", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001325.tgz", + "integrity": "sha512-sB1bZHjseSjDtijV1Hb7PB2Zd58Kyx+n/9EotvZ4Qcz2K3d0lWB8dB4nb8wN/TsOGFq3UuAm0zQZNQ4SoR7TrQ==", "dev": true }, "chalk": { @@ -14319,9 +14308,9 @@ "dev": true }, "is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "requires": { "has-tostringtag": "^1.0.0" @@ -14353,10 +14342,13 @@ } }, "is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", - "dev": true + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } }, "is-stream": { "version": "2.0.1", @@ -15867,12 +15859,12 @@ "dev": true }, "jsx-ast-utils": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz", - "integrity": "sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.2.2.tgz", + "integrity": "sha512-HDAyJ4MNQBboGpUnHAVUNJs6X0lh058s6FuixsFGP7MgJYpD6Vasd6nzSG5iIfXu1zAYlHJ/zsOKNlrenTUBnw==", "dev": true, "requires": { - "array-includes": "^3.1.3", + "array-includes": "^3.1.4", "object.assign": "^4.1.2" } }, @@ -16111,7 +16103,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true }, "object-inspect": { "version": "1.12.0", @@ -16378,9 +16371,9 @@ "dev": true }, "prettier": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz", - "integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true }, "prettier-linter-helpers": { @@ -16425,6 +16418,7 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, "requires": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -16434,7 +16428,8 @@ "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true } } }, @@ -17307,9 +17302,9 @@ "dev": true }, "webpack": { - "version": "5.70.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.70.0.tgz", - "integrity": "sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==", + "version": "5.71.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.71.0.tgz", + "integrity": "sha512-g4dFT7CFG8LY0iU5G8nBL6VlkT21Z7dcYDpJAEJV5Q1WLb9UwnFbrem1k7K52ILqEmomN7pnzWFxxE6SlDY56A==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.3", diff --git a/package.json b/package.json index 256054f2..d971301b 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@testing-library/react": "^13.0.0", "@types/react": "^17.0.40", "babel-loader": "^8.2.3", - "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "cross-env": "^7.0.3", "eslint": "^8.11.0", "eslint-config-prettier": "^8.5.0", @@ -31,7 +30,6 @@ "highcharts": "^10.0.0", "jest": "^27.5.1", "prettier": "^2.6.0", - "prop-types": "^15.8.1", "react": "^18.0.0", "react-dom": "^18.0.0", "react-test-renderer": "^18.0.0", diff --git a/packages/react-jsx-highcharts/README.md b/packages/react-jsx-highcharts/README.md index 26411061..2ba44386 100644 --- a/packages/react-jsx-highcharts/README.md +++ b/packages/react-jsx-highcharts/README.md @@ -22,7 +22,7 @@ React JSX Highcharts also enables you to write your _own_ Highcharts components, You'll need the peer dependencies too -`npm install --save react react-dom prop-types highcharts@^9.0.0` +`npm install --save react react-dom highcharts@^9.0.0` ## Licensing diff --git a/packages/react-jsx-highcharts/package.json b/packages/react-jsx-highcharts/package.json index be83c100..dd5cbb3e 100644 --- a/packages/react-jsx-highcharts/package.json +++ b/packages/react-jsx-highcharts/package.json @@ -68,8 +68,7 @@ "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0 || ^10.0.0", "react": "^16.8.6 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0", - "prop-types": "^15.0.0" + "react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0" }, "browserslist": [ "ie >= 11" diff --git a/packages/react-jsx-highcharts/src/components/Annotation/Annotation.js b/packages/react-jsx-highcharts/src/components/Annotation/Annotation.js index b92dc630..e61d1f3d 100644 --- a/packages/react-jsx-highcharts/src/components/Annotation/Annotation.js +++ b/packages/react-jsx-highcharts/src/components/Annotation/Annotation.js @@ -1,5 +1,4 @@ import { useRef, useEffect, memo } from 'react'; -import PropTypes from 'prop-types'; import { v4 as uuid } from 'uuid'; import { logModuleErrorMessage } from '../../utils/warnings'; import useChart from '../UseChart'; @@ -38,10 +37,6 @@ const Annotation = memo(props => { return null; }); -Annotation.propTypes = { - id: PropTypes.oneOfType([PropTypes.string, PropTypes.func]) -}; - Annotation.displayName = 'Annotation'; export default Annotation; diff --git a/packages/react-jsx-highcharts/src/components/Axis/Axis.js b/packages/react-jsx-highcharts/src/components/Axis/Axis.js index 5e0e4418..443963c1 100644 --- a/packages/react-jsx-highcharts/src/components/Axis/Axis.js +++ b/packages/react-jsx-highcharts/src/components/Axis/Axis.js @@ -1,10 +1,8 @@ import * as React from 'react'; import { useEffect, useState, useRef } from 'react'; -import PropTypes from 'prop-types'; import { v4 as uuid } from 'uuid'; import AxisContext from '../AxisContext'; import { getNonEventHandlerProps, getEventsConfig } from '../../utils/events'; -import { validAxisTypes } from '../../utils/propTypeValidators'; import useModifiedProps from '../UseModifiedProps'; import useChart from '../UseChart'; import createProvidedAxis from './createProvidedAxis'; @@ -91,11 +89,4 @@ const createAxis = (chart, props, dynamicAxis) => { return axis; }; -Axis.propTypes = { - type: validAxisTypes, - id: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), - children: PropTypes.node, - dynamicAxis: PropTypes.bool -}; - export default Axis; diff --git a/packages/react-jsx-highcharts/src/components/BarSeries/BarSeries.js b/packages/react-jsx-highcharts/src/components/BarSeries/BarSeries.js index bc6ba25c..5c4c8a7f 100644 --- a/packages/react-jsx-highcharts/src/components/BarSeries/BarSeries.js +++ b/packages/react-jsx-highcharts/src/components/BarSeries/BarSeries.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { useEffect } from 'react'; -import PropTypes from 'prop-types'; import Series from '../Series'; import useChart from '../UseChart'; @@ -13,7 +12,5 @@ const BarSeries = props => { return ; }; -BarSeries.propTypes = { - id: PropTypes.oneOfType([PropTypes.string, PropTypes.func]) -}; + export default BarSeries; diff --git a/packages/react-jsx-highcharts/src/components/BaseChart/BaseChart.js b/packages/react-jsx-highcharts/src/components/BaseChart/BaseChart.js index ad049413..d59ebba0 100644 --- a/packages/react-jsx-highcharts/src/components/BaseChart/BaseChart.js +++ b/packages/react-jsx-highcharts/src/components/BaseChart/BaseChart.js @@ -1,9 +1,7 @@ import * as React from 'react'; import { useState, useEffect, useRef, useLayoutEffect } from 'react'; -import PropTypes from 'prop-types'; import ChartContext from '../ChartContext'; import usePrevious from '../UsePrevious'; -import { validChartTypes } from '../../utils/propTypeValidators'; import createProvidedChart from './createProvidedChart'; const noop = c => c; @@ -123,9 +121,4 @@ const initHighcharts = (props, domNode) => { return myChart; }; -BaseChart.propTypes = { - chartCreationFunc: PropTypes.func.isRequired, - chartType: validChartTypes.isRequired -}; - export default BaseChart; diff --git a/packages/react-jsx-highcharts/src/components/Chart/Chart.js b/packages/react-jsx-highcharts/src/components/Chart/Chart.js index 2c5980d7..5103c555 100644 --- a/packages/react-jsx-highcharts/src/components/Chart/Chart.js +++ b/packages/react-jsx-highcharts/src/components/Chart/Chart.js @@ -1,5 +1,4 @@ import { useEffect, useRef, memo } from 'react'; -import PropTypes from 'prop-types'; import { getNonEventHandlerProps } from '../../utils/events'; import useModifiedProps from '../UseModifiedProps'; import useChart from '../UseChart'; @@ -43,20 +42,6 @@ const updateChart = (config, chart) => { chart.needsRedraw(); }; -Chart.propTypes = { - type: PropTypes.string, - width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - onAddSeries: PropTypes.func, - onAfterPrint: PropTypes.func, - onBeforePrint: PropTypes.func, - onClick: PropTypes.func, - onLoad: PropTypes.func, - onRedraw: PropTypes.func, - onRender: PropTypes.func, - onSelection: PropTypes.func -}; - Chart.displayName = 'Chart'; export default Chart; diff --git a/packages/react-jsx-highcharts/src/components/Credits/Credits.js b/packages/react-jsx-highcharts/src/components/Credits/Credits.js index b5b7152c..59aecd46 100644 --- a/packages/react-jsx-highcharts/src/components/Credits/Credits.js +++ b/packages/react-jsx-highcharts/src/components/Credits/Credits.js @@ -1,5 +1,3 @@ -import PropTypes from 'prop-types'; - import useChartUpdate from '../UseChartUpdate'; const Credits = ({ enabled = true, ...restProps }) => { @@ -16,7 +14,4 @@ const updateCredits = (chart, config) => { chart.addCredits(config, true); }; -Credits.propTypes = { - enabled: PropTypes.bool -}; export default Credits; diff --git a/packages/react-jsx-highcharts/src/components/Debug/Debug.js b/packages/react-jsx-highcharts/src/components/Debug/Debug.js index 52df251d..bd5f9fde 100644 --- a/packages/react-jsx-highcharts/src/components/Debug/Debug.js +++ b/packages/react-jsx-highcharts/src/components/Debug/Debug.js @@ -1,5 +1,4 @@ import { useEffect } from 'react'; -import PropTypes from 'prop-types'; import useChart from '../UseChart'; const Debug = ({ varName = 'chart' }) => { @@ -20,8 +19,4 @@ const Debug = ({ varName = 'chart' }) => { return null; }; -Debug.propTypes = { - varName: PropTypes.string -}; - export default Debug; diff --git a/packages/react-jsx-highcharts/src/components/HighchartsSparkline/HighchartsSparkline.js b/packages/react-jsx-highcharts/src/components/HighchartsSparkline/HighchartsSparkline.js index 7cd7c6ed..4e65ad31 100644 --- a/packages/react-jsx-highcharts/src/components/HighchartsSparkline/HighchartsSparkline.js +++ b/packages/react-jsx-highcharts/src/components/HighchartsSparkline/HighchartsSparkline.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { useMemo } from 'react'; -import PropTypes from 'prop-types'; import HighchartsChart from '../HighchartsChart'; import Chart from '../Chart'; import XAxis from '../XAxis'; @@ -88,14 +87,4 @@ const HighchartsSparkline = ({ ); }; -HighchartsSparkline.propTypes = { - height: PropTypes.number, - width: PropTypes.number, - margin: PropTypes.array, - style: PropTypes.object, - plotOptions: PropTypes.object, - series: PropTypes.node, - children: PropTypes.node -}; - export default HighchartsSparkline; diff --git a/packages/react-jsx-highcharts/src/components/Legend/Legend.js b/packages/react-jsx-highcharts/src/components/Legend/Legend.js index df7d5db0..d2c3407c 100644 --- a/packages/react-jsx-highcharts/src/components/Legend/Legend.js +++ b/packages/react-jsx-highcharts/src/components/Legend/Legend.js @@ -1,5 +1,4 @@ import { memo } from 'react'; -import PropTypes from 'prop-types'; import useChartUpdate from '../UseChartUpdate'; const Legend = memo(({ children = null, enabled = true, ...restProps }) => { @@ -16,9 +15,6 @@ const updateLegend = (chart, config) => { chart.update({ legend: config }, false); }; -Legend.propTypes = { - enabled: PropTypes.bool -}; Legend.displayName = 'Legend'; export default Legend; diff --git a/packages/react-jsx-highcharts/src/components/Loading/Loading.js b/packages/react-jsx-highcharts/src/components/Loading/Loading.js index 4b80e7e9..ceb88803 100644 --- a/packages/react-jsx-highcharts/src/components/Loading/Loading.js +++ b/packages/react-jsx-highcharts/src/components/Loading/Loading.js @@ -1,5 +1,4 @@ import { useEffect, memo } from 'react'; -import PropTypes from 'prop-types'; import useModifiedProps from '../UseModifiedProps'; import useChart from '../UseChart'; @@ -31,13 +30,5 @@ const updateLoading = (config, chart) => { chart.update({ loading: config }, true); }; -Loading.propTypes = { - isLoading: PropTypes.bool, - hideDuration: PropTypes.number, - labelStyle: PropTypes.object, - showDuration: PropTypes.number, - style: PropTypes.object -}; - Loading.displayName = 'Loading'; export default Loading; diff --git a/packages/react-jsx-highcharts/src/components/Options3d/Options3d.js b/packages/react-jsx-highcharts/src/components/Options3d/Options3d.js index c5f28e77..7a45e8bd 100644 --- a/packages/react-jsx-highcharts/src/components/Options3d/Options3d.js +++ b/packages/react-jsx-highcharts/src/components/Options3d/Options3d.js @@ -1,5 +1,4 @@ import { useEffect, memo } from 'react'; -import PropTypes from 'prop-types'; import { log3DModuleErrorMessage } from '../../utils/warnings'; import useHighcharts from '../UseHighcharts'; import useChart from '../UseChart'; @@ -81,16 +80,6 @@ const update3dOptions = (chart, props) => { chart.update(opts, true); }; -Options3d.propTypes = { - alpha: PropTypes.number, - axisLabelPosition: PropTypes.string, - beta: PropTypes.number, - depth: PropTypes.number, - fitToPlot: PropTypes.bool, - frame: PropTypes.object, - viewDistance: PropTypes.number -}; - Options3d.displayName = 'Options3d'; export default Options3d; diff --git a/packages/react-jsx-highcharts/src/components/PlotBandLine/PlotBand.js b/packages/react-jsx-highcharts/src/components/PlotBandLine/PlotBand.js index b3d69fad..093e8f82 100644 --- a/packages/react-jsx-highcharts/src/components/PlotBandLine/PlotBand.js +++ b/packages/react-jsx-highcharts/src/components/PlotBandLine/PlotBand.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { memo } from 'react'; -import PropTypes from 'prop-types'; import PlotBandLineContext from '../PlotBandLineContext'; import usePlotBandLineLifecycle from './UsePlotBandLineLifecycle'; @@ -18,13 +17,5 @@ const PlotBand = memo(props => { ); }); -PlotBand.propTypes = { - id: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), - from: PropTypes.any.isRequired, - to: PropTypes.any.isRequired, - color: PropTypes.string, - children: PropTypes.node -}; - PlotBand.displayName = 'PlotBand'; export default PlotBand; diff --git a/packages/react-jsx-highcharts/src/components/PlotBandLine/PlotLine.js b/packages/react-jsx-highcharts/src/components/PlotBandLine/PlotLine.js index e0b0bc91..b49fc9bc 100644 --- a/packages/react-jsx-highcharts/src/components/PlotBandLine/PlotLine.js +++ b/packages/react-jsx-highcharts/src/components/PlotBandLine/PlotLine.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { memo } from 'react'; -import PropTypes from 'prop-types'; import PlotBandLineContext from '../PlotBandLineContext'; import usePlotBandLineLifecycle from './UsePlotBandLineLifecycle'; @@ -18,12 +17,5 @@ const PlotLine = memo(props => { ); }); -PlotLine.propTypes = { - id: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), - value: PropTypes.any.isRequired, - color: PropTypes.string, - children: PropTypes.node -}; - PlotLine.displayName = 'PlotLine'; export default PlotLine; diff --git a/packages/react-jsx-highcharts/src/components/Series/Series.js b/packages/react-jsx-highcharts/src/components/Series/Series.js index fee3ec35..f281ff00 100644 --- a/packages/react-jsx-highcharts/src/components/Series/Series.js +++ b/packages/react-jsx-highcharts/src/components/Series/Series.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { memo, useRef, useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; import { v4 as uuid } from 'uuid'; import SeriesContext from '../SeriesContext'; import { getNonEventHandlerProps, getEventsConfig } from '../../utils/events'; @@ -131,23 +130,6 @@ const Series = memo( } ); -Series.displayName = 'Series'; - -Series.propTypes = { - id: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), - type: PropTypes.string, - data: PropTypes.any, - isDataEqual: PropTypes.func, - visible: PropTypes.bool, - children: PropTypes.node, - axisId: PropTypes.string, - requiresAxis: PropTypes.bool, - jsxOptions: PropTypes.shape({ - animation: PropTypes.bool, - updatePoints: PropTypes.bool - }) -}; - const getSeriesConfig = (props, axis, colorAxis, requiresAxis) => { const { id, data, ...rest } = props; @@ -172,4 +154,6 @@ const getSeriesConfig = (props, axis, colorAxis, requiresAxis) => { return config; }; +Series.displayName = 'Series'; + export default Series; diff --git a/packages/react-jsx-highcharts/src/components/Tooltip/Tooltip.js b/packages/react-jsx-highcharts/src/components/Tooltip/Tooltip.js index 677c38ca..0e5a8356 100644 --- a/packages/react-jsx-highcharts/src/components/Tooltip/Tooltip.js +++ b/packages/react-jsx-highcharts/src/components/Tooltip/Tooltip.js @@ -1,5 +1,4 @@ import { useEffect, memo } from 'react'; -import PropTypes from 'prop-types'; import useChart from '../UseChart'; import useHighcharts from '../UseHighcharts'; import useModifiedProps from '../UseModifiedProps'; @@ -45,8 +44,4 @@ const updateTooltip = (chart, config) => { Tooltip.displayName = 'Tooltip'; -Tooltip.propTypes = { - enabled: PropTypes.bool -}; - export default Tooltip; diff --git a/packages/react-jsx-highcharts/src/components/WithSeriesType/index.js b/packages/react-jsx-highcharts/src/components/WithSeriesType/index.js index 464db47b..ebf8a2e7 100644 --- a/packages/react-jsx-highcharts/src/components/WithSeriesType/index.js +++ b/packages/react-jsx-highcharts/src/components/WithSeriesType/index.js @@ -1,22 +1,12 @@ import * as React from 'react'; -import PropTypes from 'prop-types'; import Series from '../Series'; // This HOC returns Series component with injected type -export default function withSeriesType( - seriesType, - additionalProps = {}, - additionalPropTypes = {} -) { +export default function withSeriesType(seriesType, additionalProps = {}) { const SeriesComponent = props => ( ); - SeriesComponent.propTypes = { - id: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), - ...additionalPropTypes - }; - SeriesComponent.displayName = `${seriesType}Series`; return SeriesComponent; diff --git a/packages/react-jsx-highcharts/src/components/YAxis/YAxis.js b/packages/react-jsx-highcharts/src/components/YAxis/YAxis.js index 6ae59cf3..0b38aa2c 100644 --- a/packages/react-jsx-highcharts/src/components/YAxis/YAxis.js +++ b/packages/react-jsx-highcharts/src/components/YAxis/YAxis.js @@ -1,14 +1,10 @@ import * as React from 'react'; -import PropTypes from 'prop-types'; import Axis from '../Axis'; const YAxis = ({ type = 'linear', ...restProps }) => ( ); -YAxis.propTypes = { - type: PropTypes.string -}; YAxis.displayName = 'YAxis'; YAxis.Title = Axis.Title; diff --git a/packages/react-jsx-highcharts/src/components/ZAxis/ZAxis.js b/packages/react-jsx-highcharts/src/components/ZAxis/ZAxis.js index 9c6a5776..e57d15a3 100644 --- a/packages/react-jsx-highcharts/src/components/ZAxis/ZAxis.js +++ b/packages/react-jsx-highcharts/src/components/ZAxis/ZAxis.js @@ -1,14 +1,10 @@ import * as React from 'react'; -import PropTypes from 'prop-types'; import Axis from '../Axis'; const ZAxis = ({ type = 'linear', ...restProps }) => ( ); -ZAxis.propTypes = { - type: PropTypes.string -}; ZAxis.displayName = 'ZAxis'; ZAxis.Title = Axis.Title; export default ZAxis; diff --git a/packages/react-jsx-highcharts/src/index.js b/packages/react-jsx-highcharts/src/index.js index 8baa620e..b396cc66 100644 --- a/packages/react-jsx-highcharts/src/index.js +++ b/packages/react-jsx-highcharts/src/index.js @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types'; import withSeriesType from './components/WithSeriesType'; // Main provider @@ -27,7 +26,6 @@ export { default as YAxis } from './components/YAxis'; export { default as ZAxis } from './components/ZAxis'; const axisNotRequired = { requiresAxis: false }; -const hasParentSeries = { baseSeries: PropTypes.string.isRequired }; // Series export const AreaRangeSeries = withSeriesType('AreaRange'); @@ -35,7 +33,7 @@ export const AreaSeries = withSeriesType('Area'); export const AreaSplineRangeSeries = withSeriesType('AreaSplineRange'); export const AreaSplineSeries = withSeriesType('AreaSpline'); export { default as BarSeries } from './components/BarSeries'; -export const BellCurveSeries = withSeriesType('BellCurve', {}, hasParentSeries); +export const BellCurveSeries = withSeriesType('BellCurve', {}); export const BoxPlotSeries = withSeriesType('BoxPlot'); export const BubbleSeries = withSeriesType('Bubble'); export const BulletSeries = withSeriesType('Bullet'); @@ -49,7 +47,7 @@ export const FunnelSeries = withSeriesType('Funnel', axisNotRequired); export const Funnel3dSeries = withSeriesType('Funnel3d'); export const GaugeSeries = withSeriesType('Gauge'); export const HeatmapSeries = withSeriesType('Heatmap'); -export const HistogramSeries = withSeriesType('Histogram', {}, hasParentSeries); +export const HistogramSeries = withSeriesType('Histogram', {}); export const ItemSeries = withSeriesType('Item'); export const LineSeries = withSeriesType('Line'); export const NetworkGraphSeries = withSeriesType('NetworkGraph'); @@ -57,7 +55,7 @@ export const PackedBubbleSeries = withSeriesType( 'PackedBubble', axisNotRequired ); -export const ParetoSeries = withSeriesType('Pareto', {}, hasParentSeries); +export const ParetoSeries = withSeriesType('Pareto', {}); export const PieSeries = withSeriesType('Pie', axisNotRequired); export const PolygonSeries = withSeriesType('Polygon'); export const PyramidSeries = withSeriesType('Pyramid', axisNotRequired); diff --git a/packages/react-jsx-highcharts/src/utils/propTypeValidators.js b/packages/react-jsx-highcharts/src/utils/propTypeValidators.js deleted file mode 100644 index 6f9e69e2..00000000 --- a/packages/react-jsx-highcharts/src/utils/propTypeValidators.js +++ /dev/null @@ -1,10 +0,0 @@ -import PropTypes from 'prop-types'; - -export const validChartTypes = PropTypes.oneOf(['chart', 'stockChart']); - -export const validAxisTypes = PropTypes.oneOf([ - 'category', - 'linear', - 'logarithmic', - 'datetime' -]); diff --git a/packages/react-jsx-highcharts/test/components/WithSeriesType/index.spec.js b/packages/react-jsx-highcharts/test/components/WithSeriesType/index.spec.js index 227e4758..cc30eddd 100644 --- a/packages/react-jsx-highcharts/test/components/WithSeriesType/index.spec.js +++ b/packages/react-jsx-highcharts/test/components/WithSeriesType/index.spec.js @@ -1,7 +1,6 @@ import * as React from 'react'; import ShallowRenderer from 'react-test-renderer/shallow'; -import PropTypes from 'prop-types'; import withSeriesType from '../../../src/components/WithSeriesType'; import Series from '../../../src/components/Series'; @@ -36,20 +35,6 @@ describe('withSeriesType', () => { expect(result.props).toHaveProperty('data', [1, 2, 3, 4]); }); - it(`should set id propType`, () => { - const SeriesComponent = withSeriesType('line'); - expect(SeriesComponent.propTypes).toHaveProperty('id'); - }); - - it(`should add additionalPropTypes`, () => { - const SeriesComponent = withSeriesType( - 'line', - {}, - { baseSeries: PropTypes.string.isRequired } - ); - expect(SeriesComponent.propTypes).toHaveProperty('baseSeries'); - }); - it(`should pass additionalProps to Series`, () => { const SeriesComponent = withSeriesType('line', { requiresAxis: false }); renderer.render(); diff --git a/packages/react-jsx-highmaps/README.md b/packages/react-jsx-highmaps/README.md index fc985127..f70480e9 100644 --- a/packages/react-jsx-highmaps/README.md +++ b/packages/react-jsx-highmaps/README.md @@ -12,7 +12,7 @@ A project for integrating [Highmaps](https://github.com/highcharts/highcharts) i You'll need the peer dependencies too -`npm install --save react react-dom prop-types highcharts@^9.0.0` +`npm install --save react react-dom highcharts@^9.0.0` ## Licensing diff --git a/packages/react-jsx-highmaps/package.json b/packages/react-jsx-highmaps/package.json index 4f034020..60152c7d 100644 --- a/packages/react-jsx-highmaps/package.json +++ b/packages/react-jsx-highmaps/package.json @@ -50,7 +50,6 @@ }, "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0 || ^10.0.0", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0" }, diff --git a/packages/react-jsx-highmaps/src/components/MapNavigation/MapNavigation.js b/packages/react-jsx-highmaps/src/components/MapNavigation/MapNavigation.js index 5f951057..2479de17 100644 --- a/packages/react-jsx-highmaps/src/components/MapNavigation/MapNavigation.js +++ b/packages/react-jsx-highmaps/src/components/MapNavigation/MapNavigation.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { useEffect, useState } from 'react'; -import PropTypes from 'prop-types'; import { useModifiedProps, useChart, @@ -62,8 +61,4 @@ const updateMapNavigation = (config, chart) => { chart.update({ mapNavigation: config }, true); }; -MapNavigation.propTypes = { - enabled: PropTypes.bool -}; - export default MapNavigation; diff --git a/packages/react-jsx-highmaps/src/components/MapNavigation/MapNavigationButton.js b/packages/react-jsx-highmaps/src/components/MapNavigation/MapNavigationButton.js index 024bde35..ecda5d3f 100644 --- a/packages/react-jsx-highmaps/src/components/MapNavigation/MapNavigationButton.js +++ b/packages/react-jsx-highmaps/src/components/MapNavigation/MapNavigationButton.js @@ -1,5 +1,4 @@ import { useEffect } from 'react'; -import PropTypes from 'prop-types'; import { useHighcharts, useChart } from 'react-jsx-highcharts'; const MapNavigationButton = props => { @@ -45,8 +44,4 @@ const updateMapNavigationButton = (type, config, chart) => { }); }; -MapNavigationButton.propTypes = { - type: PropTypes.oneOf(['zoomIn', 'zoomOut']).isRequired -}; - export default MapNavigationButton; diff --git a/packages/react-jsx-highstock/README.md b/packages/react-jsx-highstock/README.md index 96429aca..30e0e033 100644 --- a/packages/react-jsx-highstock/README.md +++ b/packages/react-jsx-highstock/README.md @@ -28,7 +28,7 @@ React JSX Highcharts also enables you to write your _own_ Highcharts components, You'll need the peer dependencies too -`npm install --save react react-dom prop-types highcharts@^9.0.0` +`npm install --save react react-dom highcharts@^9.0.0` ## Licensing diff --git a/packages/react-jsx-highstock/package.json b/packages/react-jsx-highstock/package.json index 645587a5..eadf862e 100644 --- a/packages/react-jsx-highstock/package.json +++ b/packages/react-jsx-highstock/package.json @@ -67,7 +67,6 @@ }, "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0 || ^10.0.0", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.6 || ^17.0.0 || ^18.0.0" }, diff --git a/packages/react-jsx-highstock/src/components/Navigator/Navigator.js b/packages/react-jsx-highstock/src/components/Navigator/Navigator.js index be1698c8..414b2cb7 100644 --- a/packages/react-jsx-highstock/src/components/Navigator/Navigator.js +++ b/packages/react-jsx-highstock/src/components/Navigator/Navigator.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; import { useModifiedProps, useChart, @@ -53,8 +52,4 @@ const updateNavigator = (config, chart) => { chart.update({ navigator: config }, true); }; -Navigator.propTypes = { - enabled: PropTypes.bool -}; - export default Navigator; diff --git a/packages/react-jsx-highstock/src/components/Navigator/NavigatorAxis.js b/packages/react-jsx-highstock/src/components/Navigator/NavigatorAxis.js index a4d0e1f0..290ec9b8 100644 --- a/packages/react-jsx-highstock/src/components/Navigator/NavigatorAxis.js +++ b/packages/react-jsx-highstock/src/components/Navigator/NavigatorAxis.js @@ -6,7 +6,6 @@ import { cloneElement, isValidElement } from 'react'; -import PropTypes from 'prop-types'; import { useAxis, useModifiedProps, @@ -52,7 +51,4 @@ const updateNavigatorAxis = (config, axis) => { axis.update(config); }; -NavigatorAxis.propTypes = { - axisId: PropTypes.string.isRequired -}; export default NavigatorAxis; diff --git a/packages/react-jsx-highstock/src/components/Navigator/NavigatorSeries.js b/packages/react-jsx-highstock/src/components/Navigator/NavigatorSeries.js index 631f68b6..31599db6 100644 --- a/packages/react-jsx-highstock/src/components/Navigator/NavigatorSeries.js +++ b/packages/react-jsx-highstock/src/components/Navigator/NavigatorSeries.js @@ -1,5 +1,4 @@ import { useEffect } from 'react'; -import PropTypes from 'prop-types'; import { useSeries } from 'react-jsx-highcharts'; const NavigatorSeries = props => { @@ -25,7 +24,4 @@ const updateNavigatorSeries = (series, config) => { series.update(config); }; -NavigatorSeries.propTypes = { - seriesId: PropTypes.string -}; export default NavigatorSeries; diff --git a/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelector.js b/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelector.js index 292560e7..625825da 100644 --- a/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelector.js +++ b/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelector.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; import { useHighcharts, useAxis, @@ -85,8 +84,4 @@ const createRenderRangeSelector = (chart, axis) => { }; }; -RangeSelector.propTypes = { - enabled: PropTypes.bool -}; - export default RangeSelector; diff --git a/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelectorButton.js b/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelectorButton.js index 376f4b2e..0e9f75b4 100644 --- a/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelectorButton.js +++ b/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelectorButton.js @@ -1,5 +1,4 @@ import { useEffect } from 'react'; -import PropTypes from 'prop-types'; import { getEventsConfig, useChart } from 'react-jsx-highcharts'; const RangeSelectorButton = ({ @@ -90,22 +89,4 @@ const updateRangeSelectorButtons = (config, chart) => { }); }; -RangeSelectorButton.propTypes = { - count: PropTypes.number, - type: PropTypes.oneOf([ - 'millisecond', - 'second', - 'minute', - 'hour', - 'day', - 'week', - 'month', - 'ytd', - 'all' - ]), - offsetMin: PropTypes.number.isRequired, - offsetMax: PropTypes.number.isRequired, - dataGrouping: PropTypes.object -}; - export default RangeSelectorButton; diff --git a/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelectorInput.js b/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelectorInput.js index 058e963d..283c3db1 100644 --- a/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelectorInput.js +++ b/packages/react-jsx-highstock/src/components/RangeSelector/RangeSelectorInput.js @@ -1,5 +1,4 @@ import { useEffect } from 'react'; -import PropTypes from 'prop-types'; import { useModifiedProps, useChart } from 'react-jsx-highcharts'; const RangeSelectorInput = ({ enabled = true, ...restProps }) => { @@ -50,9 +49,4 @@ const updateRangeSelectorInputs = (config, chart) => { }); }; -RangeSelectorInput.propTypes = { - update: PropTypes.func, // Provided by ChartProvider - enabled: PropTypes.bool -}; - export default RangeSelectorInput; diff --git a/packages/react-jsx-highstock/src/components/Scrollbar/Scrollbar.js b/packages/react-jsx-highstock/src/components/Scrollbar/Scrollbar.js index a9b7c7c1..484ab822 100644 --- a/packages/react-jsx-highstock/src/components/Scrollbar/Scrollbar.js +++ b/packages/react-jsx-highstock/src/components/Scrollbar/Scrollbar.js @@ -1,6 +1,5 @@ import * as React from 'react'; import { useEffect } from 'react'; -import PropTypes from 'prop-types'; import { useModifiedProps, useChart } from 'react-jsx-highcharts'; const Scrollbar = ({ children, enabled = true, ...restProps }) => { @@ -33,8 +32,4 @@ const updateScrollbar = (config, chart) => { chart.update({ scrollbar: config }, true); }; -Scrollbar.propTypes = { - enabled: PropTypes.bool -}; - export default Scrollbar;