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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
33a32441e991e126e5e874f831bd3afc237a3ecf
1+
f5ce642deed7c74c5ae5df54ec4340a8d028eac9

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

Lines changed: 10 additions & 4 deletions
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

Lines changed: 10 additions & 4 deletions
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

Lines changed: 5 additions & 4 deletions
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

Lines changed: 5 additions & 4 deletions
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

Lines changed: 5 additions & 4 deletions
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

Lines changed: 5 additions & 4 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 3 additions & 2 deletions
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__;

0 commit comments

Comments
 (0)