Skip to content

Commit 8bfe306

Browse files
committed
Remove propTypes
1 parent ecd9289 commit 8bfe306

File tree

5 files changed

+3
-118
lines changed

5 files changed

+3
-118
lines changed

packages/react-daterange-picker/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"dependencies": {
5252
"clsx": "^2.0.0",
5353
"make-event-props": "^1.6.0",
54-
"prop-types": "^15.6.0",
5554
"react-calendar": "^4.6.0",
5655
"react-date-picker": "^10.5.0",
5756
"react-fit": "^1.7.0"

packages/react-daterange-picker/src/DateRangePicker.tsx

Lines changed: 3 additions & 51 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 Calendar from 'react-calendar';
98
import Fit from 'react-fit';
109

1110
import DateInput from 'react-date-picker/dist/esm/DateInput';
1211

13-
import { isMaxDate, isMinDate, 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

@@ -686,50 +684,4 @@ const DateRangePicker: React.FC<DateRangePickerProps> = function DateRangePicker
686684
);
687685
};
688686

689-
const isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]);
690-
691-
const isValueOrValueArray = PropTypes.oneOfType([isValue, rangeOf(isValue)]);
692-
693-
DateRangePicker.propTypes = {
694-
autoFocus: PropTypes.bool,
695-
calendarAriaLabel: PropTypes.string,
696-
calendarClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
697-
calendarIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
698-
className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
699-
clearAriaLabel: PropTypes.string,
700-
clearIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
701-
closeCalendar: PropTypes.bool,
702-
'data-testid': PropTypes.string,
703-
dayAriaLabel: PropTypes.string,
704-
dayPlaceholder: PropTypes.string,
705-
disableCalendar: PropTypes.bool,
706-
disabled: PropTypes.bool,
707-
format: PropTypes.string,
708-
id: PropTypes.string,
709-
isOpen: PropTypes.bool,
710-
locale: PropTypes.string,
711-
maxDate: isMaxDate,
712-
maxDetail: PropTypes.oneOf(allViews),
713-
minDate: isMinDate,
714-
monthAriaLabel: PropTypes.string,
715-
monthPlaceholder: PropTypes.string,
716-
name: PropTypes.string,
717-
nativeInputAriaLabel: PropTypes.string,
718-
onCalendarClose: PropTypes.func,
719-
onCalendarOpen: PropTypes.func,
720-
onChange: PropTypes.func,
721-
onFocus: PropTypes.func,
722-
openCalendarOnFocus: PropTypes.bool,
723-
rangeDivider: PropTypes.node,
724-
required: PropTypes.bool,
725-
showLeadingZeros: PropTypes.bool,
726-
value: isValueOrValueArray,
727-
yearAriaLabel: PropTypes.string,
728-
yearPlaceholder: PropTypes.string,
729-
};
730-
731-
if (isBrowser) {
732-
DateRangePicker.propTypes.portalContainer = PropTypes.instanceOf(HTMLElement);
733-
}
734-
735687
export default DateRangePicker;

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

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

sample/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"license": "MIT",
1717
"dependencies": {
1818
"@wojtekmaj/react-daterange-picker": "latest",
19-
"prop-types": "^15.6.0",
2019
"react": "^18.2.0",
2120
"react-dom": "^18.2.0"
2221
},

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,6 @@ __metadata:
12211221
make-event-props: "npm:^1.6.0"
12221222
nodemon: "npm:^3.0.0"
12231223
prettier: "npm:^3.2.0"
1224-
prop-types: "npm:^15.6.0"
12251224
react: "npm:^18.2.0"
12261225
react-calendar: "npm:^4.6.0"
12271226
react-date-picker: "npm:^10.5.0"

0 commit comments

Comments
 (0)