Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e8052d8

Browse files
author
Wang Yilin
committedOct 28, 2021
fixup! fixup! [React Refresh] handle nested namespace
1 parent 36fb999 commit e8052d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎packages/react-refresh/src/ReactFreshBabelPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ export default function(babel, opts = {}) {
486486
break;
487487
case 'TSModuleBlock':
488488
insertAfterPath = path;
489-
programPath = insertAfterPath.parentPath;
489+
programPath = insertAfterPath.parentPath.parentPath;
490490
break;
491491
case 'ExportNamedDeclaration':
492492
insertAfterPath = path.parentPath;
@@ -711,7 +711,7 @@ export default function(babel, opts = {}) {
711711
break;
712712
case 'TSModuleBlock':
713713
insertAfterPath = path;
714-
programPath = insertAfterPath.parentPath;
714+
programPath = insertAfterPath.parentPath.parentPath;
715715
break;
716716
case 'ExportNamedDeclaration':
717717
insertAfterPath = path.parentPath;

0 commit comments

Comments
 (0)
Please sign in to comment.