Skip to content

Commit cf94a4a

Browse files
committed
Revert "Support writing to this.refs from userspace" (#28877)
Reverts #28867 It broke some tests, reverting until we figure out why to avoid having too much delay in the sync. DiffTrain build for [f5ce642](f5ce642)
1 parent 627e1be commit cf94a4a

23 files changed

+89
-57
lines changed

compiled/facebook-www/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
33a32441e991e126e5e874f831bd3afc237a3ecf
1+
f5ce642deed7c74c5ae5df54ec4340a8d028eac9

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

+10-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "19.0.0-www-classic-830ece8b";
27+
var ReactVersion = "19.0.0-www-classic-dd15d2bd";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -233,14 +233,20 @@ if (__DEV__) {
233233

234234
var assign = Object.assign;
235235

236+
var emptyObject = {};
237+
238+
{
239+
Object.freeze(emptyObject);
240+
}
236241
/**
237242
* Base class helpers for the updating state of a component.
238243
*/
239244

240245
function Component(props, context, updater) {
241246
this.props = props;
242-
this.context = context;
243-
this.refs = {}; // We initialize the default updater but the real one gets injected by the
247+
this.context = context; // If a component has string refs, we will assign a different object later.
248+
249+
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
244250
// renderer.
245251

246252
this.updater = updater || ReactNoopUpdateQueue;
@@ -357,7 +363,7 @@ if (__DEV__) {
357363
this.props = props;
358364
this.context = context; // If a component has string refs, we will assign a different object later.
359365

360-
this.refs = {};
366+
this.refs = emptyObject;
361367
this.updater = updater || ReactNoopUpdateQueue;
362368
}
363369

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

+10-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "19.0.0-www-modern-b720dc57";
27+
var ReactVersion = "19.0.0-www-modern-8003ee33";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -233,14 +233,20 @@ if (__DEV__) {
233233

234234
var assign = Object.assign;
235235

236+
var emptyObject = {};
237+
238+
{
239+
Object.freeze(emptyObject);
240+
}
236241
/**
237242
* Base class helpers for the updating state of a component.
238243
*/
239244

240245
function Component(props, context, updater) {
241246
this.props = props;
242-
this.context = context;
243-
this.refs = {}; // We initialize the default updater but the real one gets injected by the
247+
this.context = context; // If a component has string refs, we will assign a different object later.
248+
249+
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
244250
// renderer.
245251

246252
this.updater = updater || ReactNoopUpdateQueue;
@@ -357,7 +363,7 @@ if (__DEV__) {
357363
this.props = props;
358364
this.context = context; // If a component has string refs, we will assign a different object later.
359365

360-
this.refs = {};
366+
this.refs = emptyObject;
361367
this.updater = updater || ReactNoopUpdateQueue;
362368
}
363369

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ var ReactNoopUpdateQueue = {
4545
enqueueReplaceState: function () {},
4646
enqueueSetState: function () {}
4747
},
48-
assign = Object.assign;
48+
assign = Object.assign,
49+
emptyObject = {};
4950
function Component(props, context, updater) {
5051
this.props = props;
5152
this.context = context;
52-
this.refs = {};
53+
this.refs = emptyObject;
5354
this.updater = updater || ReactNoopUpdateQueue;
5455
}
5556
Component.prototype.isReactComponent = {};
@@ -72,7 +73,7 @@ ComponentDummy.prototype = Component.prototype;
7273
function PureComponent(props, context, updater) {
7374
this.props = props;
7475
this.context = context;
75-
this.refs = {};
76+
this.refs = emptyObject;
7677
this.updater = updater || ReactNoopUpdateQueue;
7778
}
7879
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -694,4 +695,4 @@ exports.useSyncExternalStore = function (
694695
exports.useTransition = function () {
695696
return ReactSharedInternals.H.useTransition();
696697
};
697-
exports.version = "19.0.0-www-classic-69b8fc3f";
698+
exports.version = "19.0.0-www-classic-c379aa62";

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ var ReactNoopUpdateQueue = {
4545
enqueueReplaceState: function () {},
4646
enqueueSetState: function () {}
4747
},
48-
assign = Object.assign;
48+
assign = Object.assign,
49+
emptyObject = {};
4950
function Component(props, context, updater) {
5051
this.props = props;
5152
this.context = context;
52-
this.refs = {};
53+
this.refs = emptyObject;
5354
this.updater = updater || ReactNoopUpdateQueue;
5455
}
5556
Component.prototype.isReactComponent = {};
@@ -72,7 +73,7 @@ ComponentDummy.prototype = Component.prototype;
7273
function PureComponent(props, context, updater) {
7374
this.props = props;
7475
this.context = context;
75-
this.refs = {};
76+
this.refs = emptyObject;
7677
this.updater = updater || ReactNoopUpdateQueue;
7778
}
7879
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -694,4 +695,4 @@ exports.useSyncExternalStore = function (
694695
exports.useTransition = function () {
695696
return ReactSharedInternals.H.useTransition();
696697
};
697-
exports.version = "19.0.0-www-modern-69b8fc3f";
698+
exports.version = "19.0.0-www-modern-c379aa62";

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ var ReactNoopUpdateQueue = {
4949
enqueueReplaceState: function () {},
5050
enqueueSetState: function () {}
5151
},
52-
assign = Object.assign;
52+
assign = Object.assign,
53+
emptyObject = {};
5354
function Component(props, context, updater) {
5455
this.props = props;
5556
this.context = context;
56-
this.refs = {};
57+
this.refs = emptyObject;
5758
this.updater = updater || ReactNoopUpdateQueue;
5859
}
5960
Component.prototype.isReactComponent = {};
@@ -76,7 +77,7 @@ ComponentDummy.prototype = Component.prototype;
7677
function PureComponent(props, context, updater) {
7778
this.props = props;
7879
this.context = context;
79-
this.refs = {};
80+
this.refs = emptyObject;
8081
this.updater = updater || ReactNoopUpdateQueue;
8182
}
8283
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -698,7 +699,7 @@ exports.useSyncExternalStore = function (
698699
exports.useTransition = function () {
699700
return ReactSharedInternals.H.useTransition();
700701
};
701-
exports.version = "19.0.0-www-classic-3379708b";
702+
exports.version = "19.0.0-www-classic-6d3239ac";
702703
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
703704
"function" ===
704705
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ var ReactNoopUpdateQueue = {
4949
enqueueReplaceState: function () {},
5050
enqueueSetState: function () {}
5151
},
52-
assign = Object.assign;
52+
assign = Object.assign,
53+
emptyObject = {};
5354
function Component(props, context, updater) {
5455
this.props = props;
5556
this.context = context;
56-
this.refs = {};
57+
this.refs = emptyObject;
5758
this.updater = updater || ReactNoopUpdateQueue;
5859
}
5960
Component.prototype.isReactComponent = {};
@@ -76,7 +77,7 @@ ComponentDummy.prototype = Component.prototype;
7677
function PureComponent(props, context, updater) {
7778
this.props = props;
7879
this.context = context;
79-
this.refs = {};
80+
this.refs = emptyObject;
8081
this.updater = updater || ReactNoopUpdateQueue;
8182
}
8283
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -698,7 +699,7 @@ exports.useSyncExternalStore = function (
698699
exports.useTransition = function () {
699700
return ReactSharedInternals.H.useTransition();
700701
};
701-
exports.version = "19.0.0-www-modern-3379708b";
702+
exports.version = "19.0.0-www-modern-6d3239ac";
702703
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
703704
"function" ===
704705
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "19.0.0-www-classic-9f5bb472";
69+
var ReactVersion = "19.0.0-www-classic-033703c4";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -13846,6 +13846,7 @@ if (__DEV__) {
1384613846
var instance = workInProgress.stateNode;
1384713847
instance.props = newProps;
1384813848
instance.state = workInProgress.memoizedState;
13849+
instance.refs = {};
1384913850
initializeUpdateQueue(workInProgress);
1385013851
var contextType = ctor.contextType;
1385113852

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "19.0.0-www-modern-a3d75b83";
69+
var ReactVersion = "19.0.0-www-modern-7fadda4f";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -13574,6 +13574,7 @@ if (__DEV__) {
1357413574
var instance = workInProgress.stateNode;
1357513575
instance.props = newProps;
1357613576
instance.state = workInProgress.memoizedState;
13577+
instance.refs = {};
1357713578
initializeUpdateQueue(workInProgress);
1357813579
var contextType = ctor.contextType;
1357913580

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -3891,6 +3891,7 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
38913891
var instance = workInProgress.stateNode;
38923892
instance.props = newProps;
38933893
instance.state = workInProgress.memoizedState;
3894+
instance.refs = {};
38943895
initializeUpdateQueue(workInProgress);
38953896
var contextType = ctor.contextType;
38963897
"object" === typeof contextType && null !== contextType
@@ -10618,7 +10619,7 @@ var slice = Array.prototype.slice,
1061810619
return null;
1061910620
},
1062010621
bundleType: 0,
10621-
version: "19.0.0-www-classic-3d35a032",
10622+
version: "19.0.0-www-classic-e5fcf28b",
1062210623
rendererPackageName: "react-art"
1062310624
};
1062410625
var internals$jscomp$inline_1322 = {
@@ -10649,7 +10650,7 @@ var internals$jscomp$inline_1322 = {
1064910650
scheduleRoot: null,
1065010651
setRefreshHandler: null,
1065110652
getCurrentFiber: null,
10652-
reconcilerVersion: "19.0.0-www-classic-3d35a032"
10653+
reconcilerVersion: "19.0.0-www-classic-e5fcf28b"
1065310654
};
1065410655
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1065510656
var hook$jscomp$inline_1323 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -4364,6 +4364,7 @@ function updateClassComponent(
43644364
context = workInProgress.stateNode;
43654365
context.props = nextProps;
43664366
context.state = workInProgress.memoizedState;
4367+
context.refs = {};
43674368
initializeUpdateQueue(workInProgress);
43684369
contextType = Component.contextType;
43694370
context.context =
@@ -10097,7 +10098,7 @@ var slice = Array.prototype.slice,
1009710098
return null;
1009810099
},
1009910100
bundleType: 0,
10100-
version: "19.0.0-www-modern-954d0f23",
10101+
version: "19.0.0-www-modern-20a4f736",
1010110102
rendererPackageName: "react-art"
1010210103
};
1010310104
var internals$jscomp$inline_1307 = {
@@ -10128,7 +10129,7 @@ var internals$jscomp$inline_1307 = {
1012810129
scheduleRoot: null,
1012910130
setRefreshHandler: null,
1013010131
getCurrentFiber: null,
10131-
reconcilerVersion: "19.0.0-www-modern-954d0f23"
10132+
reconcilerVersion: "19.0.0-www-modern-20a4f736"
1013210133
};
1013310134
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1013410135
var hook$jscomp$inline_1308 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -18627,6 +18627,7 @@ if (__DEV__) {
1862718627
var instance = workInProgress.stateNode;
1862818628
instance.props = newProps;
1862918629
instance.state = workInProgress.memoizedState;
18630+
instance.refs = {};
1863018631
initializeUpdateQueue(workInProgress);
1863118632
var contextType = ctor.contextType;
1863218633

@@ -36252,7 +36253,7 @@ if (__DEV__) {
3625236253
return root;
3625336254
}
3625436255

36255-
var ReactVersion = "19.0.0-www-classic-849b84c4";
36256+
var ReactVersion = "19.0.0-www-classic-509be4f1";
3625636257

3625736258
function createPortal$1(
3625836259
children,

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -31723,6 +31723,7 @@ if (__DEV__) {
3172331723
var instance = workInProgress.stateNode;
3172431724
instance.props = newProps;
3172531725
instance.state = workInProgress.memoizedState;
31726+
instance.refs = {};
3172631727
initializeUpdateQueue(workInProgress);
3172731728
var contextType = ctor.contextType;
3172831729

@@ -45768,7 +45769,7 @@ if (__DEV__) {
4576845769
return root;
4576945770
}
4577045771

45771-
var ReactVersion = "19.0.0-www-modern-1c20f055";
45772+
var ReactVersion = "19.0.0-www-modern-8b7a101a";
4577245773

4577345774
function createPortal$1(
4577445775
children,

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -4742,6 +4742,7 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
47424742
var instance = workInProgress.stateNode;
47434743
instance.props = newProps;
47444744
instance.state = workInProgress.memoizedState;
4745+
instance.refs = {};
47454746
initializeUpdateQueue(workInProgress);
47464747
var contextType = ctor.contextType;
47474748
"object" === typeof contextType && null !== contextType
@@ -17032,7 +17033,7 @@ Internals.Events = [
1703217033
var devToolsConfig$jscomp$inline_1729 = {
1703317034
findFiberByHostInstance: getClosestInstanceFromNode,
1703417035
bundleType: 0,
17035-
version: "19.0.0-www-classic-4f60324b",
17036+
version: "19.0.0-www-classic-38c43cf6",
1703617037
rendererPackageName: "react-dom"
1703717038
};
1703817039
var internals$jscomp$inline_2160 = {
@@ -17062,7 +17063,7 @@ var internals$jscomp$inline_2160 = {
1706217063
scheduleRoot: null,
1706317064
setRefreshHandler: null,
1706417065
getCurrentFiber: null,
17065-
reconcilerVersion: "19.0.0-www-classic-4f60324b"
17066+
reconcilerVersion: "19.0.0-www-classic-38c43cf6"
1706617067
};
1706717068
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1706817069
var hook$jscomp$inline_2161 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17528,4 +17529,4 @@ exports.useFormState = function (action, initialState, permalink) {
1752817529
exports.useFormStatus = function () {
1752917530
return ReactSharedInternals.H.useHostTransitionStatus();
1753017531
};
17531-
exports.version = "19.0.0-www-classic-4f60324b";
17532+
exports.version = "19.0.0-www-classic-38c43cf6";

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -7796,6 +7796,7 @@ function updateClassComponent(
77967796
context = workInProgress.stateNode;
77977797
context.props = nextProps;
77987798
context.state = workInProgress.memoizedState;
7799+
context.refs = {};
77997800
initializeUpdateQueue(workInProgress);
78007801
contextType = Component.contextType;
78017802
context.context =
@@ -16394,7 +16395,7 @@ Internals.Events = [
1639416395
var devToolsConfig$jscomp$inline_1722 = {
1639516396
findFiberByHostInstance: getClosestInstanceFromNode,
1639616397
bundleType: 0,
16397-
version: "19.0.0-www-modern-6bb7ac6f",
16398+
version: "19.0.0-www-modern-1217c10a",
1639816399
rendererPackageName: "react-dom"
1639916400
};
1640016401
var internals$jscomp$inline_2162 = {
@@ -16424,7 +16425,7 @@ var internals$jscomp$inline_2162 = {
1642416425
scheduleRoot: null,
1642516426
setRefreshHandler: null,
1642616427
getCurrentFiber: null,
16427-
reconcilerVersion: "19.0.0-www-modern-6bb7ac6f"
16428+
reconcilerVersion: "19.0.0-www-modern-1217c10a"
1642816429
};
1642916430
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1643016431
var hook$jscomp$inline_2163 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16732,4 +16733,4 @@ exports.useFormState = function (action, initialState, permalink) {
1673216733
exports.useFormStatus = function () {
1673316734
return ReactSharedInternals.H.useHostTransitionStatus();
1673416735
};
16735-
exports.version = "19.0.0-www-modern-6bb7ac6f";
16736+
exports.version = "19.0.0-www-modern-1217c10a";

0 commit comments

Comments
 (0)