File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/react-server-dom-webpack/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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 } ,
You can’t perform that action at this time.
0 commit comments