Skip to content

Commit 0835f97

Browse files
committed
Remove propTypes
1 parent 99cd493 commit 0835f97

File tree

5 files changed

+3
-90
lines changed

5 files changed

+3
-90
lines changed

packages/react-time-picker/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
"clsx": "^2.0.0",
121121
"get-user-locale": "^2.2.1",
122122
"make-event-props": "^1.6.0",
123-
"prop-types": "^15.6.0",
124123
"react-clock": "^4.5.0",
125124
"react-fit": "^1.7.0",
126125
"update-input-width": "^1.4.0"

packages/react-time-picker/src/TimePicker.tsx

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22

33
import { createElement, useCallback, useEffect, useMemo, useRef, useState } from 'react';
44
import { createPortal } from 'react-dom';
5-
import PropTypes from 'prop-types';
65
import makeEventProps from 'make-event-props';
76
import clsx from 'clsx';
87
import Clock from 'react-clock';
98
import Fit from 'react-fit';
109

1110
import TimeInput from './TimeInput.js';
1211

13-
import { isTime, rangeOf } from './shared/propTypes.js';
14-
15-
import type { ReactNodeArray } from 'prop-types';
1612
import type {
1713
ClassName,
1814
CloseReason,
@@ -58,7 +54,9 @@ const ClearIcon = (
5854
</svg>
5955
);
6056

61-
type Icon = React.ReactElement | ReactNodeArray | null | string | number | boolean;
57+
type ReactNodeLike = React.ReactNode | string | number | boolean | null | undefined;
58+
59+
type Icon = ReactNodeLike | ReactNodeLike[];
6260

6361
type IconOrRenderFunction = Icon | React.ComponentType | React.ReactElement;
6462

@@ -642,49 +640,4 @@ const TimePicker: React.FC<TimePickerProps> = function TimePicker(props) {
642640
);
643641
};
644642

645-
const isValue = PropTypes.oneOfType([isTime, PropTypes.instanceOf(Date)]);
646-
647-
const isValueOrValueArray = PropTypes.oneOfType([isValue, rangeOf(isValue)]);
648-
649-
TimePicker.propTypes = {
650-
amPmAriaLabel: PropTypes.string,
651-
autoFocus: PropTypes.bool,
652-
className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
653-
clearAriaLabel: PropTypes.string,
654-
clearIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
655-
clockAriaLabel: PropTypes.string,
656-
clockClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
657-
clockIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
658-
closeClock: PropTypes.bool,
659-
'data-testid': PropTypes.string,
660-
disableClock: PropTypes.bool,
661-
disabled: PropTypes.bool,
662-
format: PropTypes.string,
663-
hourAriaLabel: PropTypes.string,
664-
hourPlaceholder: PropTypes.string,
665-
id: PropTypes.string,
666-
isOpen: PropTypes.bool,
667-
locale: PropTypes.string,
668-
maxDetail: PropTypes.oneOf(allViews),
669-
maxTime: isTime,
670-
minTime: isTime,
671-
minuteAriaLabel: PropTypes.string,
672-
minutePlaceholder: PropTypes.string,
673-
name: PropTypes.string,
674-
nativeInputAriaLabel: PropTypes.string,
675-
onChange: PropTypes.func,
676-
onClockClose: PropTypes.func,
677-
onClockOpen: PropTypes.func,
678-
onFocus: PropTypes.func,
679-
openClockOnFocus: PropTypes.bool,
680-
required: PropTypes.bool,
681-
secondAriaLabel: PropTypes.string,
682-
secondPlaceholder: PropTypes.string,
683-
value: isValueOrValueArray,
684-
};
685-
686-
if (isBrowser) {
687-
TimePicker.propTypes.portalContainer = PropTypes.instanceOf(HTMLElement);
688-
}
689-
690643
export default TimePicker;

packages/react-time-picker/src/shared/propTypes.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

sample/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
},
1616
"license": "MIT",
1717
"dependencies": {
18-
"prop-types": "^15.6.2",
1918
"react": "^18.2.0",
2019
"react-dom": "^18.2.0",
2120
"react-time-picker": "latest"

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4236,7 +4236,6 @@ __metadata:
42364236
make-event-props: "npm:^1.6.0"
42374237
nodemon: "npm:^3.0.0"
42384238
prettier: "npm:^3.2.0"
4239-
prop-types: "npm:^15.6.0"
42404239
react: "npm:^18.2.0"
42414240
react-clock: "npm:^4.5.0"
42424241
react-dom: "npm:^18.2.0"

0 commit comments

Comments
 (0)