Skip to content

Commit dee0c82

Browse files
committed
Unrevert "Support writing to this.refs from userspace" (#28879)
Reverts #28877 We found the cause of the regression and should be able to land this again. DiffTrain build for commit b039be6.
1 parent 490702d commit dee0c82

File tree

7 files changed

+46
-34
lines changed

7 files changed

+46
-34
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<d6449a2b2f866a42a4d0c4e9ceba56bf>>
10+
* @generated SignedSource<<eb0bcf528c3de17c6744b81c980f6aec>>
1111
*/
1212

1313
'use strict';
@@ -10939,7 +10939,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
1093910939
var instance = workInProgress.stateNode;
1094010940
instance.props = newProps;
1094110941
instance.state = workInProgress.memoizedState;
10942-
instance.refs = {};
10942+
10943+
{
10944+
// When string refs are used in create-react-class legacy components,
10945+
// we need to make refs writable unless we patch all such copies of the
10946+
// class code that sets to a frozen emptyObject.
10947+
instance.refs = {};
10948+
}
10949+
1094310950
initializeUpdateQueue(workInProgress);
1094410951
var contextType = ctor.contextType;
1094510952

@@ -22989,7 +22996,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2298922996
return root;
2299022997
}
2299122998

22992-
var ReactVersion = '19.0.0-canary-88928511';
22999+
var ReactVersion = '19.0.0-canary-d851d267';
2299323000

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

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<5657642071f954739542e489d20fe745>>
10+
* @generated SignedSource<<89ae74e0102293ea28fa8a01ffa204a7>>
1111
*/
1212

1313
'use strict';
@@ -27,7 +27,7 @@ if (
2727
}
2828
var dynamicFlagsUntyped = require('ReactNativeInternalFeatureFlags');
2929

30-
var ReactVersion = '19.0.0-canary-bbf3fbcd';
30+
var ReactVersion = '19.0.0-canary-ffcb8911';
3131

3232
// Re-export dynamic flags from the internal module.
3333
var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-exporting to avoid a dynamic look-up on
@@ -270,21 +270,14 @@ var ReactNoopUpdateQueue = {
270270

271271
var assign = Object.assign;
272272

273-
var emptyObject = {};
274-
275-
{
276-
Object.freeze(emptyObject);
277-
}
278273
/**
279274
* Base class helpers for the updating state of a component.
280275
*/
281276

282-
283277
function Component(props, context, updater) {
284278
this.props = props;
285-
this.context = context; // If a component has string refs, we will assign a different object later.
286-
287-
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
279+
this.context = context;
280+
this.refs = {}; // We initialize the default updater but the real one gets injected by the
288281
// renderer.
289282

290283
this.updater = updater || ReactNoopUpdateQueue;
@@ -384,7 +377,7 @@ function PureComponent(props, context, updater) {
384377
this.props = props;
385378
this.context = context; // If a component has string refs, we will assign a different object later.
386379

387-
this.refs = emptyObject;
380+
this.refs = {};
388381
this.updater = updater || ReactNoopUpdateQueue;
389382
}
390383

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

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

1313
"use strict";
@@ -50,12 +50,11 @@ var ReactNoopUpdateQueue = {
5050
enqueueReplaceState: function () {},
5151
enqueueSetState: function () {}
5252
},
53-
assign = Object.assign,
54-
emptyObject = {};
53+
assign = Object.assign;
5554
function Component(props, context, updater) {
5655
this.props = props;
5756
this.context = context;
58-
this.refs = emptyObject;
57+
this.refs = {};
5958
this.updater = updater || ReactNoopUpdateQueue;
6059
}
6160
Component.prototype.isReactComponent = {};
@@ -78,7 +77,7 @@ ComponentDummy.prototype = Component.prototype;
7877
function PureComponent(props, context, updater) {
7978
this.props = props;
8079
this.context = context;
81-
this.refs = emptyObject;
80+
this.refs = {};
8281
this.updater = updater || ReactNoopUpdateQueue;
8382
}
8483
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -679,4 +678,4 @@ exports.useSyncExternalStore = function (
679678
exports.useTransition = function () {
680679
return ReactSharedInternals.H.useTransition();
681680
};
682-
exports.version = "19.0.0-canary-55ecd63c";
681+
exports.version = "19.0.0-canary-a22219fc";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

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

1313
"use strict";
@@ -54,12 +54,11 @@ var ReactNoopUpdateQueue = {
5454
enqueueReplaceState: function () {},
5555
enqueueSetState: function () {}
5656
},
57-
assign = Object.assign,
58-
emptyObject = {};
57+
assign = Object.assign;
5958
function Component(props, context, updater) {
6059
this.props = props;
6160
this.context = context;
62-
this.refs = emptyObject;
61+
this.refs = {};
6362
this.updater = updater || ReactNoopUpdateQueue;
6463
}
6564
Component.prototype.isReactComponent = {};
@@ -82,7 +81,7 @@ ComponentDummy.prototype = Component.prototype;
8281
function PureComponent(props, context, updater) {
8382
this.props = props;
8483
this.context = context;
85-
this.refs = emptyObject;
84+
this.refs = {};
8685
this.updater = updater || ReactNoopUpdateQueue;
8786
}
8887
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -683,7 +682,7 @@ exports.useSyncExternalStore = function (
683682
exports.useTransition = function () {
684683
return ReactSharedInternals.H.useTransition();
685684
};
686-
exports.version = "19.0.0-canary-966142ac";
685+
exports.version = "19.0.0-canary-64485d5e";
687686
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
688687
"function" ===
689688
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6f6e375fce9d0700434f863f70f0e2e5ea180426
1+
b039be627dd7403d7d2f63a48c8d263d955ce456

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<077c2c0ff9555d4a76d629316b424c88>>
10+
* @generated SignedSource<<e23105fe3f0439fc7cd9d5143f2ae9f4>>
1111
*/
1212

1313
'use strict';
@@ -13963,7 +13963,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
1396313963
var instance = workInProgress.stateNode;
1396413964
instance.props = newProps;
1396513965
instance.state = workInProgress.memoizedState;
13966-
instance.refs = {};
13966+
13967+
{
13968+
// When string refs are used in create-react-class legacy components,
13969+
// we need to make refs writable unless we patch all such copies of the
13970+
// class code that sets to a frozen emptyObject.
13971+
instance.refs = {};
13972+
}
13973+
1396713974
initializeUpdateQueue(workInProgress);
1396813975
var contextType = ctor.contextType;
1396913976

@@ -26059,7 +26066,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2605926066
return root;
2606026067
}
2606126068

26062-
var ReactVersion = '19.0.0-canary-4b13525c';
26069+
var ReactVersion = '19.0.0-canary-e93cff57';
2606326070

2606426071
/*
2606526072
* 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: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<326542d2f2bb8bbc5fb69f5994f1ea0f>>
10+
* @generated SignedSource<<eb0c79f9647d9ccb19601e79d168e28a>>
1111
*/
1212

1313
'use strict';
@@ -14202,7 +14202,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
1420214202
var instance = workInProgress.stateNode;
1420314203
instance.props = newProps;
1420414204
instance.state = workInProgress.memoizedState;
14205-
instance.refs = {};
14205+
14206+
{
14207+
// When string refs are used in create-react-class legacy components,
14208+
// we need to make refs writable unless we patch all such copies of the
14209+
// class code that sets to a frozen emptyObject.
14210+
instance.refs = {};
14211+
}
14212+
1420614213
initializeUpdateQueue(workInProgress);
1420714214
var contextType = ctor.contextType;
1420814215

@@ -26474,7 +26481,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
2647426481
return root;
2647526482
}
2647626483

26477-
var ReactVersion = '19.0.0-canary-2d608505';
26484+
var ReactVersion = '19.0.0-canary-f458e15c';
2647826485

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

0 commit comments

Comments
 (0)