From 0e635cc4a558286a39783d93d3a65d35415b40f5 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Wed, 26 Jul 2023 00:11:46 +0200 Subject: [PATCH] Remove propTypes from internal components --- test/LocaleOptions.tsx | 6 ------ test/MaxDetailOptions.tsx | 6 ------ test/ValidityOptions.tsx | 10 ---------- test/ValueOptions.tsx | 10 ---------- test/ViewOptions.tsx | 14 -------------- test/package.json | 1 - test/yarn.lock | 1 - 7 files changed, 48 deletions(-) diff --git a/test/LocaleOptions.tsx b/test/LocaleOptions.tsx index d91fb60..564c5d8 100644 --- a/test/LocaleOptions.tsx +++ b/test/LocaleOptions.tsx @@ -1,5 +1,4 @@ import React, { useRef } from 'react'; -import PropTypes from 'prop-types'; type LocaleOptionsProps = { locale: string | undefined; @@ -103,8 +102,3 @@ export default function LocaleOptions({ locale, setLocale }: LocaleOptionsProps) ); } - -LocaleOptions.propTypes = { - locale: PropTypes.string, - setLocale: PropTypes.func.isRequired, -}; diff --git a/test/MaxDetailOptions.tsx b/test/MaxDetailOptions.tsx index e3ddc36..c4dbdca 100644 --- a/test/MaxDetailOptions.tsx +++ b/test/MaxDetailOptions.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import type { Detail } from './shared/types'; @@ -41,8 +40,3 @@ export default function MaxDetailOptions({ maxDetail, setMaxDetail }: MaxDetailO ); } - -MaxDetailOptions.propTypes = { - maxDetail: PropTypes.oneOf(allViews).isRequired, - setMaxDetail: PropTypes.func.isRequired, -}; diff --git a/test/ValidityOptions.tsx b/test/ValidityOptions.tsx index 1b387d0..28eb6d3 100644 --- a/test/ValidityOptions.tsx +++ b/test/ValidityOptions.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { getISOLocalDate } from '@wojtekmaj/date-utils'; type ValidityOptionsProps = { @@ -75,12 +74,3 @@ export default function ValidityOptions({ ); } - -ValidityOptions.propTypes = { - maxDate: PropTypes.instanceOf(Date), - minDate: PropTypes.instanceOf(Date), - required: PropTypes.bool, - setMaxDate: PropTypes.func.isRequired, - setMinDate: PropTypes.func.isRequired, - setRequired: PropTypes.func.isRequired, -}; diff --git a/test/ValueOptions.tsx b/test/ValueOptions.tsx index f766201..f0488ad 100644 --- a/test/ValueOptions.tsx +++ b/test/ValueOptions.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { getISOLocalDateTime } from '@wojtekmaj/date-utils'; import type { LooseValue } from './shared/types'; @@ -91,12 +90,3 @@ export default function ValueOptions({ setValue, value }: ValueOptionsProps) { ); } - -const isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]); - -const isValueOrValueArray = PropTypes.oneOfType([isValue, PropTypes.arrayOf(isValue)]); - -ValueOptions.propTypes = { - setValue: PropTypes.func.isRequired, - value: isValueOrValueArray, -}; diff --git a/test/ViewOptions.tsx b/test/ViewOptions.tsx index 22142cf..67a7801 100644 --- a/test/ViewOptions.tsx +++ b/test/ViewOptions.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; type ViewOptionsProps = { disabled: boolean; @@ -107,16 +106,3 @@ export default function ViewOptions({ ); } - -ViewOptions.propTypes = { - disabled: PropTypes.bool.isRequired, - renderInPortal: PropTypes.bool.isRequired, - setDisabled: PropTypes.func.isRequired, - setRenderInPortal: PropTypes.func.isRequired, - setShowLeadingZeros: PropTypes.func.isRequired, - setShowNeighboringMonth: PropTypes.func.isRequired, - setShowWeekNumbers: PropTypes.func.isRequired, - showLeadingZeros: PropTypes.bool.isRequired, - showNeighboringMonth: PropTypes.bool.isRequired, - showWeekNumbers: PropTypes.bool.isRequired, -}; diff --git a/test/package.json b/test/package.json index c7d0756..6814dd6 100644 --- a/test/package.json +++ b/test/package.json @@ -16,7 +16,6 @@ "license": "MIT", "dependencies": { "@wojtekmaj/react-datetimerange-picker": "portal:../", - "prop-types": "^15.6.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/test/yarn.lock b/test/yarn.lock index 20a180f..bd6fad5 100644 --- a/test/yarn.lock +++ b/test/yarn.lock @@ -1714,7 +1714,6 @@ __metadata: "@vitejs/plugin-react": ^3.0.0 "@wojtekmaj/date-utils": ^1.0.0 "@wojtekmaj/react-datetimerange-picker": "portal:../" - prop-types: ^15.6.0 react: ^18.2.0 react-dom: ^18.2.0 typescript: ^5.0.0