Skip to content

Commit 3e1ebc7

Browse files
committed
Remove obsolete name property in Flight Node Register
This is a leftover from #26300 where `name` was incorporated into `$$id`.
1 parent eb616a1 commit 3e1ebc7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ module.exports = function register() {
3737

3838
const deepProxyHandlers = {
3939
get: function (target: Function, name: string, receiver: Proxy<Function>) {
40+
const [, targetName] = target.$$id.split('#');
41+
4042
switch (name) {
4143
// These names are read by the Flight runtime if you end up using the exports object.
4244
case '$$typeof':
@@ -48,7 +50,7 @@ module.exports = function register() {
4850
case '$$async':
4951
return target.$$async;
5052
case 'name':
51-
return target.name;
53+
return targetName;
5254
case 'displayName':
5355
return undefined;
5456
// We need to special case this because createElement reads it if we pass this
@@ -69,7 +71,7 @@ module.exports = function register() {
6971
);
7072
}
7173
// eslint-disable-next-line react-internal/safe-string-coercion
72-
const expression = String(target.name) + '.' + String(name);
74+
const expression = String(targetName) + '.' + String(name);
7375
throw new Error(
7476
`Cannot access ${expression} on the server. ` +
7577
'You cannot dot into a client module from a server component. ' +
@@ -185,7 +187,6 @@ module.exports = function register() {
185187
);
186188
}: any),
187189
{
188-
name: {value: name},
189190
$$typeof: {value: CLIENT_REFERENCE},
190191
$$id: {value: target.$$id + '#' + name},
191192
$$async: {value: target.$$async},

0 commit comments

Comments
 (0)