Skip to content

Commit e2bb95f

Browse files
committed
Remove warning for ref cleanup function (#28883)
Resources - RFC: reactjs/rfcs#205 - Warning implemented in #22313 - Warning enabled in #23145 - Feature added in #25686 We have warned to prevent the old behavior since 18.0.0. The new feature has been on in canary for a while but still triggering the warning. This PR cleans up the warning for 19 DiffTrain build for commit db913d8.
1 parent faed6ae commit e2bb95f

File tree

4 files changed

+13
-37
lines changed

4 files changed

+13
-37
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<fbc5f0d556063e18e8065897a4edae21>>
10+
* @generated SignedSource<<72055afa4818e8a565d07875c49b2d9d>>
1111
*/
1212

1313
'use strict';
@@ -16185,28 +16185,20 @@ function safelyDetachRef(current, nearestMountedAncestor) {
1618516185
}
1618616186
}
1618716187
} else if (typeof ref === 'function') {
16188-
var retVal;
16189-
1619016188
try {
1619116189
if (shouldProfile(current)) {
1619216190
try {
1619316191
startLayoutEffectTimer();
16194-
retVal = ref(null);
16192+
ref(null);
1619516193
} finally {
1619616194
recordLayoutEffectDuration(current);
1619716195
}
1619816196
} else {
16199-
retVal = ref(null);
16197+
ref(null);
1620016198
}
1620116199
} catch (error) {
1620216200
captureCommitPhaseError(current, nearestMountedAncestor, error);
1620316201
}
16204-
16205-
{
16206-
if (typeof retVal === 'function') {
16207-
error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(current));
16208-
}
16209-
}
1621016202
} else {
1621116203
// $FlowFixMe[incompatible-use] unable to narrow type to RefObject
1621216204
ref.current = null;
@@ -22986,7 +22978,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2298622978
return root;
2298722979
}
2298822980

22989-
var ReactVersion = '19.0.0-canary-c4e3bea9';
22981+
var ReactVersion = '19.0.0-canary-acecb093';
2299022982

2299122983
/*
2299222984
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
368202181e772d411b2445930aea1edd9428b09b
1+
db913d8e17db25045e0518f3621f1640f2390525

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<6bbaf37a7e6d0c6b86bd687aa4e09ebe>>
10+
* @generated SignedSource<<d1fd7d33d65e21b9395d92b4c9c241c6>>
1111
*/
1212

1313
'use strict';
@@ -19444,28 +19444,20 @@ function safelyDetachRef(current, nearestMountedAncestor) {
1944419444
}
1944519445
}
1944619446
} else if (typeof ref === 'function') {
19447-
var retVal;
19448-
1944919447
try {
1945019448
if (shouldProfile(current)) {
1945119449
try {
1945219450
startLayoutEffectTimer();
19453-
retVal = ref(null);
19451+
ref(null);
1945419452
} finally {
1945519453
recordLayoutEffectDuration(current);
1945619454
}
1945719455
} else {
19458-
retVal = ref(null);
19456+
ref(null);
1945919457
}
1946019458
} catch (error) {
1946119459
captureCommitPhaseError(current, nearestMountedAncestor, error);
1946219460
}
19463-
19464-
{
19465-
if (typeof retVal === 'function') {
19466-
error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(current));
19467-
}
19468-
}
1946919461
} else {
1947019462
// $FlowFixMe[incompatible-use] unable to narrow type to RefObject
1947119463
ref.current = null;
@@ -26056,7 +26048,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2605626048
return root;
2605726049
}
2605826050

26059-
var ReactVersion = '19.0.0-canary-b83624af';
26051+
var ReactVersion = '19.0.0-canary-f7d342a2';
2606026052

2606126053
/*
2606226054
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<1c5ee0ee0fef4e85b317999b53699b5f>>
10+
* @generated SignedSource<<067d8fee132e988882b3b0dcb3c6e6da>>
1111
*/
1212

1313
'use strict';
@@ -19491,28 +19491,20 @@ function safelyDetachRef(current, nearestMountedAncestor) {
1949119491
}
1949219492
}
1949319493
} else if (typeof ref === 'function') {
19494-
var retVal;
19495-
1949619494
try {
1949719495
if (shouldProfile(current)) {
1949819496
try {
1949919497
startLayoutEffectTimer();
19500-
retVal = ref(null);
19498+
ref(null);
1950119499
} finally {
1950219500
recordLayoutEffectDuration(current);
1950319501
}
1950419502
} else {
19505-
retVal = ref(null);
19503+
ref(null);
1950619504
}
1950719505
} catch (error) {
1950819506
captureCommitPhaseError(current, nearestMountedAncestor, error);
1950919507
}
19510-
19511-
{
19512-
if (typeof retVal === 'function') {
19513-
error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(current));
19514-
}
19515-
}
1951619508
} else {
1951719509
// $FlowFixMe[incompatible-use] unable to narrow type to RefObject
1951819510
ref.current = null;
@@ -26471,7 +26463,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2647126463
return root;
2647226464
}
2647326465

26474-
var ReactVersion = '19.0.0-canary-f6aae78f';
26466+
var ReactVersion = '19.0.0-canary-f9159889';
2647526467

2647626468
/*
2647726469
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol

0 commit comments

Comments
 (0)