Skip to content

Commit 14cfb2c

Browse files
committed
Remove propTypes from internal components
1 parent ec624dd commit 14cfb2c

File tree

8 files changed

+0
-56
lines changed

8 files changed

+0
-56
lines changed

test/LocaleOptions.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useRef } from 'react';
2-
import PropTypes from 'prop-types';
32

43
type LocaleOptionsProps = {
54
locale: string | undefined;
@@ -103,8 +102,3 @@ export default function LocaleOptions({ locale, setLocale }: LocaleOptionsProps)
103102
</fieldset>
104103
);
105104
}
106-
107-
LocaleOptions.propTypes = {
108-
locale: PropTypes.string,
109-
setLocale: PropTypes.func.isRequired,
110-
};

test/MaxDetailOptions.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32

43
import type { Detail } from './shared/types';
54

@@ -49,9 +48,3 @@ export default function MaxDetailOptions({
4948
</fieldset>
5049
);
5150
}
52-
53-
MaxDetailOptions.propTypes = {
54-
maxDetail: PropTypes.oneOf(allViews).isRequired,
55-
minDetail: PropTypes.oneOf(allViews).isRequired,
56-
setMaxDetail: PropTypes.func.isRequired,
57-
};

test/MinDetailOptions.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32

43
import type { Detail } from './shared/types';
54

@@ -49,9 +48,3 @@ export default function MinDetailOptions({
4948
</fieldset>
5049
);
5150
}
52-
53-
MinDetailOptions.propTypes = {
54-
maxDetail: PropTypes.oneOf(allViews).isRequired,
55-
minDetail: PropTypes.oneOf(allViews).isRequired,
56-
setMinDetail: PropTypes.func.isRequired,
57-
};

test/ValidityOptions.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32
import { getISOLocalDate } from '@wojtekmaj/date-utils';
43

54
type ValidityOptionsProps = {
@@ -75,12 +74,3 @@ export default function ValidityOptions({
7574
</fieldset>
7675
);
7776
}
78-
79-
ValidityOptions.propTypes = {
80-
maxDate: PropTypes.instanceOf(Date),
81-
minDate: PropTypes.instanceOf(Date),
82-
required: PropTypes.bool,
83-
setMaxDate: PropTypes.func.isRequired,
84-
setMinDate: PropTypes.func.isRequired,
85-
setRequired: PropTypes.func.isRequired,
86-
};

test/ValueOptions.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32
import { getDayStart, getDayEnd, getISOLocalDate } from '@wojtekmaj/date-utils';
43

54
import type { LooseValue } from './shared/types';
@@ -92,12 +91,3 @@ export default function ValueOptions({ setValue, value }: ValueOptionsProps) {
9291
</fieldset>
9392
);
9493
}
95-
96-
const isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]);
97-
98-
const isValueOrValueArray = PropTypes.oneOfType([isValue, PropTypes.arrayOf(isValue)]);
99-
100-
ValueOptions.propTypes = {
101-
setValue: PropTypes.func.isRequired,
102-
value: isValueOrValueArray,
103-
};

test/ViewOptions.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32

43
type ViewOptionsProps = {
54
disabled: boolean;
@@ -107,16 +106,3 @@ export default function ViewOptions({
107106
</fieldset>
108107
);
109108
}
110-
111-
ViewOptions.propTypes = {
112-
disabled: PropTypes.bool.isRequired,
113-
renderInPortal: PropTypes.bool.isRequired,
114-
setDisabled: PropTypes.func.isRequired,
115-
setRenderInPortal: PropTypes.func.isRequired,
116-
setShowLeadingZeros: PropTypes.func.isRequired,
117-
setShowNeighboringMonth: PropTypes.func.isRequired,
118-
setShowWeekNumbers: PropTypes.func.isRequired,
119-
showLeadingZeros: PropTypes.bool.isRequired,
120-
showNeighboringMonth: PropTypes.bool.isRequired,
121-
showWeekNumbers: PropTypes.bool.isRequired,
122-
};

test/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"dependencies": {
1818
"@wojtekmaj/date-utils": "^1.0.0",
1919
"@wojtekmaj/react-daterange-picker": "portal:../",
20-
"prop-types": "^15.6.0",
2120
"react": "^18.2.0",
2221
"react-dom": "^18.2.0"
2322
},

test/yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,6 @@ __metadata:
16441644
"@vitejs/plugin-react": ^3.0.0
16451645
"@wojtekmaj/date-utils": ^1.0.0
16461646
"@wojtekmaj/react-daterange-picker": "portal:../"
1647-
prop-types: ^15.6.0
16481647
react: ^18.2.0
16491648
react-dom: ^18.2.0
16501649
typescript: ^5.0.0

0 commit comments

Comments
 (0)