Skip to content

Commit 31e9c9e

Browse files
committed
Dedupe legacy context warnings (#30299)
Similar to other warnings about legacy APIs, only raise a warning once per component. DiffTrain build for [39e69dc](39e69dc)
1 parent 5f6d91c commit 31e9c9e

35 files changed

+128
-92
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b73dcdc04ffa2dd9f2197d796388657d64ad53be
1+
39e69dc665ef6f6dd1f9fe2f63348afb09694eab
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b73dcdc04ffa2dd9f2197d796388657d64ad53be
1+
39e69dc665ef6f6dd1f9fe2f63348afb09694eab

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,7 @@ __DEV__ &&
19981998
exports.useTransition = function () {
19991999
return resolveDispatcher().useTransition();
20002000
};
2001-
exports.version = "19.0.0-www-classic-b73dcdc04f-20240709";
2001+
exports.version = "19.0.0-www-classic-39e69dc665-20240709";
20022002
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20032003
"function" ===
20042004
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ __DEV__ &&
19781978
exports.useTransition = function () {
19791979
return resolveDispatcher().useTransition();
19801980
};
1981-
exports.version = "19.0.0-www-modern-b73dcdc04f-20240709";
1981+
exports.version = "19.0.0-www-modern-39e69dc665-20240709";
19821982
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19831983
"function" ===
19841984
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-classic-b73dcdc04f-20240709";
672+
exports.version = "19.0.0-www-classic-39e69dc665-20240709";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-modern-b73dcdc04f-20240709";
672+
exports.version = "19.0.0-www-modern-39e69dc665-20240709";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
673673
exports.useTransition = function () {
674674
return ReactSharedInternals.H.useTransition();
675675
};
676-
exports.version = "19.0.0-www-classic-b73dcdc04f-20240709";
676+
exports.version = "19.0.0-www-classic-39e69dc665-20240709";
677677
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
678678
"function" ===
679679
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
673673
exports.useTransition = function () {
674674
return ReactSharedInternals.H.useTransition();
675675
};
676-
exports.version = "19.0.0-www-modern-b73dcdc04f-20240709";
676+
exports.version = "19.0.0-www-modern-39e69dc665-20240709";
677677
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
678678
"function" ===
679679
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16937,14 +16937,14 @@ __DEV__ &&
1693716937
scheduleRoot: scheduleRoot,
1693816938
setRefreshHandler: setRefreshHandler,
1693916939
getCurrentFiber: getCurrentFiberForDevTools,
16940-
reconcilerVersion: "19.0.0-www-classic-b73dcdc04f-20240709"
16940+
reconcilerVersion: "19.0.0-www-classic-39e69dc665-20240709"
1694116941
});
1694216942
})({
1694316943
findFiberByHostInstance: function () {
1694416944
return null;
1694516945
},
1694616946
bundleType: 1,
16947-
version: "19.0.0-www-classic-b73dcdc04f-20240709",
16947+
version: "19.0.0-www-classic-39e69dc665-20240709",
1694816948
rendererPackageName: "react-art"
1694916949
});
1695016950
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6460,15 +6460,19 @@ __DEV__ &&
64606460
state
64616461
);
64626462
Component.childContextTypes &&
6463+
!didWarnAboutChildContextTypes.has(Component) &&
6464+
(didWarnAboutChildContextTypes.add(Component),
64636465
error$jscomp$0(
64646466
"%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead.",
64656467
state
6466-
);
6468+
));
64676469
Component.contextTypes &&
6470+
!didWarnAboutContextTypes.has(Component) &&
6471+
(didWarnAboutContextTypes.add(Component),
64686472
error$jscomp$0(
64696473
"%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead.",
64706474
state
6471-
);
6475+
));
64726476
"function" === typeof _instance.componentShouldUpdate &&
64736477
error$jscomp$0(
64746478
"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",
@@ -15847,6 +15851,8 @@ __DEV__ &&
1584715851
var didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
1584815852
var didWarnAboutDirectlyAssigningPropsToState = new Set();
1584915853
var didWarnAboutUndefinedDerivedState = new Set();
15854+
var didWarnAboutContextTypes = new Set();
15855+
var didWarnAboutChildContextTypes = new Set();
1585015856
var didWarnAboutInvalidateContextType = new Set();
1585115857
var didWarnOnInvalidCallback = new Set();
1585215858
Object.freeze(fakeInternalInstance);
@@ -16367,14 +16373,14 @@ __DEV__ &&
1636716373
scheduleRoot: scheduleRoot,
1636816374
setRefreshHandler: setRefreshHandler,
1636916375
getCurrentFiber: getCurrentFiberForDevTools,
16370-
reconcilerVersion: "19.0.0-www-modern-b73dcdc04f-20240709"
16376+
reconcilerVersion: "19.0.0-www-modern-39e69dc665-20240709"
1637116377
});
1637216378
})({
1637316379
findFiberByHostInstance: function () {
1637416380
return null;
1637516381
},
1637616382
bundleType: 1,
16377-
version: "19.0.0-www-modern-b73dcdc04f-20240709",
16383+
version: "19.0.0-www-modern-39e69dc665-20240709",
1637816384
rendererPackageName: "react-art"
1637916385
});
1638016386
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,

0 commit comments

Comments
 (0)