Skip to content

Commit 6a673aa

Browse files
committed
[cleanup] remove feature flags warnAboutDefaultPropsOnFunctionComponents and warnAboutStringRefs (#25980)
These feature flags are fully rolled out and easy to clean up. Let's remove them! DiffTrain build for [0fce6bb](0fce6bb) [View git log for this commit](https://github.com/facebook/react/commits/0fce6bb498357feb4465859912004b2e20fe7084)
1 parent 84aa038 commit 6a673aa

29 files changed

+122
-163
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7002a6743ebb24ed55af8f626c89dd39460230fc
1+
0fce6bb498357feb4465859912004b2e20fe7084
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7002a6743ebb24ed55af8f626c89dd39460230fc
1+
0fce6bb498357feb4465859912004b2e20fe7084

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-classic-7002a6743-20230110";
30+
var ReactVersion = "18.3.0-www-classic-0fce6bb49-20230111";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-7002a6743-20230110";
30+
var ReactVersion = "18.3.0-www-modern-0fce6bb49-20230111";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,4 +643,4 @@ exports.useSyncExternalStore = function(
643643
);
644644
};
645645
exports.useTransition = useTransition;
646-
exports.version = "18.3.0-www-classic-7002a6743-20230110";
646+
exports.version = "18.3.0-www-classic-0fce6bb49-20230111";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function(
635635
);
636636
};
637637
exports.useTransition = useTransition;
638-
exports.version = "18.3.0-www-modern-7002a6743-20230110";
638+
exports.version = "18.3.0-www-modern-0fce6bb49-20230111";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ exports.useSyncExternalStore = function(
654654
);
655655
};
656656
exports.useTransition = useTransition;
657-
exports.version = "18.3.0-www-classic-7002a6743-20230110";
657+
exports.version = "18.3.0-www-classic-0fce6bb49-20230111";
658658

659659
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
660660
if (

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ exports.useSyncExternalStore = function(
646646
);
647647
};
648648
exports.useTransition = useTransition;
649-
exports.version = "18.3.0-www-modern-7002a6743-20230110";
649+
exports.version = "18.3.0-www-modern-0fce6bb49-20230111";
650650

651651
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
652652
if (

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-classic-7002a6743-20230110";
72+
var ReactVersion = "18.3.0-www-classic-0fce6bb49-20230111";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -201,7 +201,6 @@ var enableProfilerNestedUpdateScheduledHook =
201201
var createRootStrictEffectsByDefault = false;
202202

203203
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
204-
var warnAboutStringRefs = true;
205204

206205
var FunctionComponent = 0;
207206
var ClassComponent = 1;
@@ -5558,10 +5557,8 @@ function coerceRef(returnFiber, current, element) {
55585557
typeof mixedRef !== "object"
55595558
) {
55605559
{
5561-
// TODO: Clean this up once we turn on the string ref warning for
5562-
// everyone, because the strict mode case will no longer be relevant
55635560
if (
5564-
(returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
5561+
// We warn in ReactElement.js if owner and self are equal for string refs
55655562
// because these cannot be automatically converted to an arrow function
55665563
// using a codemod. Therefore, we don't have to warn about string refs again.
55675564
!(
@@ -5577,17 +5574,15 @@ function coerceRef(returnFiber, current, element) {
55775574
getComponentNameFromFiber(returnFiber) || "Component";
55785575

55795576
if (!didWarnAboutStringRefs[componentName]) {
5580-
{
5581-
error(
5582-
'Component "%s" contains the string ref "%s". Support for string refs ' +
5583-
"will be removed in a future major release. We recommend using " +
5584-
"useRef() or createRef() instead. " +
5585-
"Learn more about using refs safely here: " +
5586-
"https://reactjs.org/link/strict-mode-string-ref",
5587-
componentName,
5588-
mixedRef
5589-
);
5590-
}
5577+
error(
5578+
'Component "%s" contains the string ref "%s". Support for string refs ' +
5579+
"will be removed in a future major release. We recommend using " +
5580+
"useRef() or createRef() instead. " +
5581+
"Learn more about using refs safely here: " +
5582+
"https://reactjs.org/link/strict-mode-string-ref",
5583+
componentName,
5584+
mixedRef
5585+
);
55915586

55925587
didWarnAboutStringRefs[componentName] = true;
55935588
}

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-modern-7002a6743-20230110";
72+
var ReactVersion = "18.3.0-www-modern-0fce6bb49-20230111";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -201,7 +201,6 @@ var enableProfilerNestedUpdateScheduledHook =
201201
var createRootStrictEffectsByDefault = false;
202202

203203
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
204-
var warnAboutStringRefs = true;
205204

206205
var FunctionComponent = 0;
207206
var ClassComponent = 1;
@@ -5320,10 +5319,8 @@ function coerceRef(returnFiber, current, element) {
53205319
typeof mixedRef !== "object"
53215320
) {
53225321
{
5323-
// TODO: Clean this up once we turn on the string ref warning for
5324-
// everyone, because the strict mode case will no longer be relevant
53255322
if (
5326-
(returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
5323+
// We warn in ReactElement.js if owner and self are equal for string refs
53275324
// because these cannot be automatically converted to an arrow function
53285325
// using a codemod. Therefore, we don't have to warn about string refs again.
53295326
!(
@@ -5339,17 +5336,15 @@ function coerceRef(returnFiber, current, element) {
53395336
getComponentNameFromFiber(returnFiber) || "Component";
53405337

53415338
if (!didWarnAboutStringRefs[componentName]) {
5342-
{
5343-
error(
5344-
'Component "%s" contains the string ref "%s". Support for string refs ' +
5345-
"will be removed in a future major release. We recommend using " +
5346-
"useRef() or createRef() instead. " +
5347-
"Learn more about using refs safely here: " +
5348-
"https://reactjs.org/link/strict-mode-string-ref",
5349-
componentName,
5350-
mixedRef
5351-
);
5352-
}
5339+
error(
5340+
'Component "%s" contains the string ref "%s". Support for string refs ' +
5341+
"will be removed in a future major release. We recommend using " +
5342+
"useRef() or createRef() instead. " +
5343+
"Learn more about using refs safely here: " +
5344+
"https://reactjs.org/link/strict-mode-string-ref",
5345+
componentName,
5346+
mixedRef
5347+
);
53535348

53545349
didWarnAboutStringRefs[componentName] = true;
53555350
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9804,7 +9804,7 @@ var slice = Array.prototype.slice,
98049804
return null;
98059805
},
98069806
bundleType: 0,
9807-
version: "18.3.0-www-classic-7002a6743-20230110",
9807+
version: "18.3.0-www-classic-0fce6bb49-20230111",
98089808
rendererPackageName: "react-art"
98099809
};
98109810
var internals$jscomp$inline_1318 = {
@@ -9835,7 +9835,7 @@ var internals$jscomp$inline_1318 = {
98359835
scheduleRoot: null,
98369836
setRefreshHandler: null,
98379837
getCurrentFiber: null,
9838-
reconcilerVersion: "18.3.0-next-7002a6743-20230110"
9838+
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
98399839
};
98409840
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
98419841
var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9471,7 +9471,7 @@ var slice = Array.prototype.slice,
94719471
return null;
94729472
},
94739473
bundleType: 0,
9474-
version: "18.3.0-www-modern-7002a6743-20230110",
9474+
version: "18.3.0-www-modern-0fce6bb49-20230111",
94759475
rendererPackageName: "react-art"
94769476
};
94779477
var internals$jscomp$inline_1309 = {
@@ -9502,7 +9502,7 @@ var internals$jscomp$inline_1309 = {
95029502
scheduleRoot: null,
95039503
setRefreshHandler: null,
95049504
getCurrentFiber: null,
9505-
reconcilerVersion: "18.3.0-next-7002a6743-20230110"
9505+
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
95069506
};
95079507
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95089508
var hook$jscomp$inline_1310 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ var createRootStrictEffectsByDefault = false;
7272
var enableClientRenderFallbackOnTextMismatch = false; // Logs additional User Timing API marks for use with an experimental profiling tool.
7373

7474
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
75-
var warnAboutStringRefs = true;
7675
var enableSuspenseCallback = true;
7776
var enableCustomElementPropertySupport = false;
7877

@@ -19789,10 +19788,8 @@ function coerceRef(returnFiber, current, element) {
1978919788
typeof mixedRef !== "object"
1979019789
) {
1979119790
{
19792-
// TODO: Clean this up once we turn on the string ref warning for
19793-
// everyone, because the strict mode case will no longer be relevant
1979419791
if (
19795-
(returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
19792+
// We warn in ReactElement.js if owner and self are equal for string refs
1979619793
// because these cannot be automatically converted to an arrow function
1979719794
// using a codemod. Therefore, we don't have to warn about string refs again.
1979819795
!(
@@ -19808,17 +19805,15 @@ function coerceRef(returnFiber, current, element) {
1980819805
getComponentNameFromFiber(returnFiber) || "Component";
1980919806

1981019807
if (!didWarnAboutStringRefs[componentName]) {
19811-
{
19812-
error(
19813-
'Component "%s" contains the string ref "%s". Support for string refs ' +
19814-
"will be removed in a future major release. We recommend using " +
19815-
"useRef() or createRef() instead. " +
19816-
"Learn more about using refs safely here: " +
19817-
"https://reactjs.org/link/strict-mode-string-ref",
19818-
componentName,
19819-
mixedRef
19820-
);
19821-
}
19808+
error(
19809+
'Component "%s" contains the string ref "%s". Support for string refs ' +
19810+
"will be removed in a future major release. We recommend using " +
19811+
"useRef() or createRef() instead. " +
19812+
"Learn more about using refs safely here: " +
19813+
"https://reactjs.org/link/strict-mode-string-ref",
19814+
componentName,
19815+
mixedRef
19816+
);
1982219817

1982319818
didWarnAboutStringRefs[componentName] = true;
1982419819
}
@@ -42695,7 +42690,7 @@ function createFiberRoot(
4269542690
return root;
4269642691
}
4269742692

42698-
var ReactVersion = "18.3.0-www-classic-7002a6743-20230110";
42693+
var ReactVersion = "18.3.0-www-classic-0fce6bb49-20230111";
4269942694

4270042695
function createPortal(
4270142696
children,

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ var createRootStrictEffectsByDefault = false;
176176
var enableClientRenderFallbackOnTextMismatch = false; // Logs additional User Timing API marks for use with an experimental profiling tool.
177177

178178
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
179-
var warnAboutStringRefs = true;
180179
var enableSuspenseCallback = true;
181180
var enableCustomElementPropertySupport = true;
182181

@@ -19586,10 +19585,8 @@ function coerceRef(returnFiber, current, element) {
1958619585
typeof mixedRef !== "object"
1958719586
) {
1958819587
{
19589-
// TODO: Clean this up once we turn on the string ref warning for
19590-
// everyone, because the strict mode case will no longer be relevant
1959119588
if (
19592-
(returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
19589+
// We warn in ReactElement.js if owner and self are equal for string refs
1959319590
// because these cannot be automatically converted to an arrow function
1959419591
// using a codemod. Therefore, we don't have to warn about string refs again.
1959519592
!(
@@ -19605,17 +19602,15 @@ function coerceRef(returnFiber, current, element) {
1960519602
getComponentNameFromFiber(returnFiber) || "Component";
1960619603

1960719604
if (!didWarnAboutStringRefs[componentName]) {
19608-
{
19609-
error(
19610-
'Component "%s" contains the string ref "%s". Support for string refs ' +
19611-
"will be removed in a future major release. We recommend using " +
19612-
"useRef() or createRef() instead. " +
19613-
"Learn more about using refs safely here: " +
19614-
"https://reactjs.org/link/strict-mode-string-ref",
19615-
componentName,
19616-
mixedRef
19617-
);
19618-
}
19605+
error(
19606+
'Component "%s" contains the string ref "%s". Support for string refs ' +
19607+
"will be removed in a future major release. We recommend using " +
19608+
"useRef() or createRef() instead. " +
19609+
"Learn more about using refs safely here: " +
19610+
"https://reactjs.org/link/strict-mode-string-ref",
19611+
componentName,
19612+
mixedRef
19613+
);
1961919614

1962019615
didWarnAboutStringRefs[componentName] = true;
1962119616
}
@@ -42419,7 +42414,7 @@ function createFiberRoot(
4241942414
return root;
4242042415
}
4242142416

42422-
var ReactVersion = "18.3.0-www-modern-7002a6743-20230110";
42417+
var ReactVersion = "18.3.0-www-modern-0fce6bb49-20230111";
4242342418

4242442419
function createPortal(
4242542420
children,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15534,7 +15534,7 @@ Internals.Events = [
1553415534
var devToolsConfig$jscomp$inline_1750 = {
1553515535
findFiberByHostInstance: getClosestInstanceFromNode,
1553615536
bundleType: 0,
15537-
version: "18.3.0-www-classic-7002a6743-20230110",
15537+
version: "18.3.0-www-classic-0fce6bb49-20230111",
1553815538
rendererPackageName: "react-dom"
1553915539
};
1554015540
var internals$jscomp$inline_2134 = {
@@ -15564,7 +15564,7 @@ var internals$jscomp$inline_2134 = {
1556415564
scheduleRoot: null,
1556515565
setRefreshHandler: null,
1556615566
getCurrentFiber: null,
15567-
reconcilerVersion: "18.3.0-next-7002a6743-20230110"
15567+
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
1556815568
};
1556915569
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1557015570
var hook$jscomp$inline_2135 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15806,4 +15806,4 @@ exports.unstable_renderSubtreeIntoContainer = function(
1580615806
);
1580715807
};
1580815808
exports.unstable_runWithPriority = runWithPriority;
15809-
exports.version = "18.3.0-next-7002a6743-20230110";
15809+
exports.version = "18.3.0-next-0fce6bb49-20230111";

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15095,7 +15095,7 @@ Internals.Events = [
1509515095
var devToolsConfig$jscomp$inline_1718 = {
1509615096
findFiberByHostInstance: getClosestInstanceFromNode,
1509715097
bundleType: 0,
15098-
version: "18.3.0-www-modern-7002a6743-20230110",
15098+
version: "18.3.0-www-modern-0fce6bb49-20230111",
1509915099
rendererPackageName: "react-dom"
1510015100
};
1510115101
var internals$jscomp$inline_2109 = {
@@ -15126,7 +15126,7 @@ var internals$jscomp$inline_2109 = {
1512615126
scheduleRoot: null,
1512715127
setRefreshHandler: null,
1512815128
getCurrentFiber: null,
15129-
reconcilerVersion: "18.3.0-next-7002a6743-20230110"
15129+
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
1513015130
};
1513115131
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1513215132
var hook$jscomp$inline_2110 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15314,4 +15314,4 @@ exports.unstable_flushControlled = function(fn) {
1531415314
}
1531515315
};
1531615316
exports.unstable_runWithPriority = runWithPriority;
15317-
exports.version = "18.3.0-next-7002a6743-20230110";
15317+
exports.version = "18.3.0-next-0fce6bb49-20230111";

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16304,7 +16304,7 @@ Internals.Events = [
1630416304
var devToolsConfig$jscomp$inline_1824 = {
1630516305
findFiberByHostInstance: getClosestInstanceFromNode,
1630616306
bundleType: 0,
16307-
version: "18.3.0-www-classic-7002a6743-20230110",
16307+
version: "18.3.0-www-classic-0fce6bb49-20230111",
1630816308
rendererPackageName: "react-dom"
1630916309
};
1631016310
(function(internals) {
@@ -16348,7 +16348,7 @@ var devToolsConfig$jscomp$inline_1824 = {
1634816348
scheduleRoot: null,
1634916349
setRefreshHandler: null,
1635016350
getCurrentFiber: null,
16351-
reconcilerVersion: "18.3.0-next-7002a6743-20230110"
16351+
reconcilerVersion: "18.3.0-next-0fce6bb49-20230111"
1635216352
});
1635316353
assign(Internals, {
1635416354
ReactBrowserEventEmitter: {
@@ -16577,7 +16577,7 @@ exports.unstable_renderSubtreeIntoContainer = function(
1657716577
);
1657816578
};
1657916579
exports.unstable_runWithPriority = runWithPriority;
16580-
exports.version = "18.3.0-next-7002a6743-20230110";
16580+
exports.version = "18.3.0-next-0fce6bb49-20230111";
1658116581

1658216582
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
1658316583
if (

0 commit comments

Comments
 (0)