Skip to content

Commit

Permalink
Remove non-JSX propTypes checks (#28326)
Browse files Browse the repository at this point in the history
Removes all `propTypes` validation called from outside the JSX
factories. Haven't touched JSX.

Tests that verify related behavior are stripped down to the
non-`propTypes` logic.

DiffTrain build for [fea900e](fea900e)
  • Loading branch information
gaearon committed Feb 16, 2024
1 parent edb6ecc commit b19c9fe
Show file tree
Hide file tree
Showing 25 changed files with 6,562 additions and 9,250 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2e470a788e359e34feeadb422daaff046baf66cc
fea900e45447214ddd6ef69076ab7e38433b5ffd
6 changes: 3 additions & 3 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-www-classic-77190284";
var ReactVersion = "18.3.0-www-classic-77843590";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -2741,9 +2741,9 @@ if (__DEV__) {
}

if (render != null) {
if (render.defaultProps != null || render.propTypes != null) {
if (render.defaultProps != null) {
error(
"forwardRef render functions do not support propTypes or defaultProps. " +
"forwardRef render functions do not support defaultProps. " +
"Did you accidentally pass a React component?"
);
}
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-www-modern-5d2c8ee0";
var ReactVersion = "18.3.0-www-modern-0bb55f38";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -2706,9 +2706,9 @@ if (__DEV__) {
}

if (render != null) {
if (render.defaultProps != null || render.propTypes != null) {
if (render.defaultProps != null) {
error(
"forwardRef render functions do not support propTypes or defaultProps. " +
"forwardRef render functions do not support defaultProps. " +
"Did you accidentally pass a React component?"
);
}
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,4 +618,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-classic-e7aae6cc";
exports.version = "18.3.0-www-classic-22e81a9f";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-modern-cbc861b3";
exports.version = "18.3.0-www-modern-f4321f8c";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-modern-0840aeae";
exports.version = "18.3.0-www-modern-e254c3a6";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit b19c9fe

Please sign in to comment.