Skip to content

Commit 2637a6f

Browse files
committed
chore(react-md): Remove prop-types package and usage
BREAKING CHANGE: There will no longer be run-time prop validation with the `prop-types` package.
1 parent 30cf056 commit 2637a6f

File tree

175 files changed

+3
-4021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+3
-4021
lines changed

packages/alert/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
"react": ">= 16.14",
4949
"react-dom": ">= 16.14"
5050
},
51-
"optionalDependencies": {
52-
"prop-types": ">= 15.6"
53-
},
5451
"publishConfig": {
5552
"access": "public"
5653
}

packages/alert/src/MessageQueue.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,3 @@ export function MessageQueue<M extends ToastMessage = ToastMessage>({
7878
</AddMessageContext.Provider>
7979
);
8080
}
81-
82-
/* istanbul ignore next */
83-
if (process.env.NODE_ENV !== "production") {
84-
try {
85-
const PropTypes = require("prop-types");
86-
MessageQueue.propTypes = {
87-
timeout: PropTypes.number,
88-
duplicates: PropTypes.oneOf(["allow", "restart", "prevent"]),
89-
defaultQueue: PropTypes.array,
90-
onActionClick: PropTypes.func,
91-
children: PropTypes.node.isRequired,
92-
};
93-
} catch (e) {}
94-
}

packages/alert/src/Snackbar.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,3 @@ export const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(
5656
);
5757
}
5858
);
59-
60-
/* istanbul ignore next */
61-
if (process.env.NODE_ENV !== "production") {
62-
try {
63-
const PropTypes = require("prop-types");
64-
65-
Snackbar.propTypes = {
66-
id: PropTypes.string.isRequired,
67-
className: PropTypes.string,
68-
children: PropTypes.node,
69-
position: PropTypes.oneOf(["bottom", "top"]),
70-
portal: PropTypes.bool,
71-
portalInto: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
72-
portalIntoId: PropTypes.string,
73-
};
74-
} catch (e) {}
75-
}

packages/alert/src/Toast.tsx

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -102,45 +102,3 @@ export const Toast = forwardRef<HTMLDivElement, ToastProps>(function Toast(
102102
</CSSTransition>
103103
);
104104
});
105-
106-
/* istanbul ignore next */
107-
if (process.env.NODE_ENV !== "production") {
108-
try {
109-
const PropTypes = require("prop-types");
110-
111-
Toast.propTypes = {
112-
visible: PropTypes.bool.isRequired,
113-
action: PropTypes.element,
114-
stacked: PropTypes.bool,
115-
twoLines: PropTypes.bool,
116-
className: PropTypes.string,
117-
classNames: PropTypes.oneOfType([
118-
PropTypes.string,
119-
PropTypes.shape({
120-
appear: PropTypes.string,
121-
appearActive: PropTypes.string,
122-
enter: PropTypes.string,
123-
enterActive: PropTypes.string,
124-
enterDone: PropTypes.string,
125-
exit: PropTypes.string,
126-
exitActive: PropTypes.string,
127-
exitDone: PropTypes.string,
128-
}),
129-
]),
130-
timeout: PropTypes.oneOfType([
131-
PropTypes.number,
132-
PropTypes.shape({
133-
enter: PropTypes.number,
134-
exit: PropTypes.number,
135-
}),
136-
]),
137-
children: PropTypes.node,
138-
onEnter: PropTypes.func,
139-
onEntering: PropTypes.func,
140-
onEntered: PropTypes.func,
141-
onExit: PropTypes.func,
142-
onExiting: PropTypes.func,
143-
onExited: PropTypes.func,
144-
};
145-
} catch (e) {}
146-
}

packages/app-bar/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
"react": ">= 16.14",
4646
"react-dom": ">= 16.14"
4747
},
48-
"optionalDependencies": {
49-
"prop-types": ">= 15.6"
50-
},
5148
"publishConfig": {
5249
"access": "public"
5350
}

packages/app-bar/src/AppBar.tsx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -165,33 +165,3 @@ export const AppBar = forwardRef<HTMLDivElement, AppBarProps>(function AppBar(
165165
</ParentContext.Provider>
166166
);
167167
});
168-
169-
/* istanbul ignore next */
170-
if (process.env.NODE_ENV !== "production") {
171-
try {
172-
const PropTypes = require("prop-types");
173-
174-
AppBar.propTypes = {
175-
className: PropTypes.string,
176-
component: PropTypes.oneOfType([
177-
PropTypes.string,
178-
PropTypes.func,
179-
PropTypes.object,
180-
]),
181-
height: PropTypes.oneOf([
182-
"none",
183-
"normal",
184-
"dense",
185-
"prominent",
186-
"prominent-dense",
187-
]),
188-
flexWrap: PropTypes.bool,
189-
children: PropTypes.node,
190-
fixed: PropTypes.bool,
191-
fixedPosition: PropTypes.oneOf(["top", "bottom"]),
192-
fixedElevation: PropTypes.bool,
193-
inheritColor: PropTypes.bool,
194-
theme: PropTypes.oneOf(["primary", "secondary", "default", "clear"]),
195-
};
196-
} catch (e) {}
197-
}

packages/app-bar/src/AppBarAction.tsx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,3 @@ export const AppBarAction = forwardRef<HTMLButtonElement, AppBarActionProps>(
4646
);
4747
}
4848
);
49-
50-
/* istanbul ignore next */
51-
if (process.env.NODE_ENV !== "production") {
52-
try {
53-
const PropTypes = require("prop-types");
54-
55-
AppBarAction.propTypes = {
56-
className: PropTypes.string,
57-
children: PropTypes.node,
58-
first: PropTypes.bool,
59-
last: PropTypes.bool,
60-
theme: PropTypes.oneOf([
61-
"primary",
62-
"secondary",
63-
"warning",
64-
"error",
65-
"clear",
66-
]),
67-
buttonType: PropTypes.oneOf(["text", "icon"]),
68-
floating: PropTypes.oneOf([
69-
"top-left",
70-
"top-right",
71-
"bottom-left",
72-
"bottom-right",
73-
]),
74-
inheritColor: PropTypes.bool,
75-
};
76-
} catch (e) {}
77-
}

packages/app-bar/src/AppBarNav.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/prop-types */
21
import { forwardRef } from "react";
32
import cn from "classnames";
43
import { Button, ButtonProps } from "@react-md/button";

packages/app-bar/src/AppBarTitle.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,3 @@ export const AppBarTitle = forwardRef<HTMLHeadingElement, AppBarTitleProps>(
5757
);
5858
}
5959
);
60-
61-
/* istanbul ignore next */
62-
if (process.env.NODE_ENV !== "production") {
63-
try {
64-
const PropTypes = require("prop-types");
65-
66-
AppBarTitle.propTypes = {
67-
className: PropTypes.string,
68-
children: PropTypes.node,
69-
keyline: PropTypes.bool,
70-
noWrap: PropTypes.bool,
71-
inheritColor: PropTypes.bool,
72-
};
73-
} catch (e) {}
74-
}

packages/autocomplete/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@
4949
"react": ">= 16.14",
5050
"react-dom": ">= 16.14"
5151
},
52-
"optionalDependencies": {
53-
"prop-types": ">= 15.6"
54-
},
5552
"publishConfig": {
5653
"access": "public"
5754
}

0 commit comments

Comments
 (0)