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 df5985b6..bb96803f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@testing-library/react": "^12.1.2", "@types/react": "^17.0.33", "babel-loader": "^8.2.3", - "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "cross-env": "^7.0.3", "eslint": "^8.4.1", "eslint-config-prettier": "^8.3.0", @@ -27,7 +26,6 @@ "highcharts": "^9.3.0", "jest": "^27.3.1", "prettier": "^2.4.1", - "prop-types": "^15.7.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react-test-renderer": "^17.0.2", @@ -3594,12 +3592,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", @@ -8638,6 +8630,7 @@ "version": "15.7.2", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "dev": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -8647,7 +8640,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", @@ -10176,7 +10170,6 @@ }, "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0", "react-dom": "^16.8.6 || ^17.0.0" } @@ -10197,7 +10190,6 @@ }, "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0", "react-dom": "^16.8.6 || ^17.0.0" } @@ -10211,7 +10203,6 @@ }, "peerDependencies": { "highcharts": "^8.0.0 || ^9.0.0", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0", "react-dom": "^16.8.6 || ^17.0.0" } @@ -12856,12 +12847,6 @@ "@babel/helper-define-polyfill-provider": "^0.2.2" } }, - "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", @@ -16621,6 +16606,7 @@ "version": "15.7.2", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "dev": true, "requires": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -16630,7 +16616,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 } } }, diff --git a/package.json b/package.json index 4e440eb4..495867ed 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@testing-library/react": "^12.1.2", "@types/react": "^17.0.33", "babel-loader": "^8.2.3", - "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "cross-env": "^7.0.3", "eslint": "^8.4.1", "eslint-config-prettier": "^8.3.0", @@ -31,7 +30,6 @@ "highcharts": "^9.3.0", "jest": "^27.3.1", "prettier": "^2.4.1", - "prop-types": "^15.7.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react-test-renderer": "^17.0.2", 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 0e19fe78..3ed616d6 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", "react": "^16.8.6 || ^17.0.0", - "react-dom": "^16.8.6 || ^17.0.0", - "prop-types": "^15.0.0" + "react-dom": "^16.8.6 || ^17.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 f27ae52c..ccacd18e 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; @@ -124,9 +122,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 6379d8e6..f9cc0bc0 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", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0", "react-dom": "^16.8.6 || ^17.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 107bbc87..6dd3b0ac 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", - "prop-types": "^15.0.0", "react": "^16.8.6 || ^17.0.0", "react-dom": "^16.8.6 || ^17.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;