File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/react-refresh/src Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export default function(opts = {}) {
20
20
const refreshReg = ts . createIdentifier ( opts . refreshReg || '$RefreshReg$' ) ;
21
21
const refreshSig = ts . createIdentifier ( opts . refreshSig || '$RefreshSig$' ) ;
22
22
return context => {
23
+ let uniqueName = 0 ;
23
24
return file => {
24
25
if ( file . isDeclarationFile ) return file ;
25
26
const containHooksLikeOrJSX =
@@ -235,7 +236,9 @@ export default function(opts = {}) {
235
236
} ;
236
237
}
237
238
function createTempVariable ( ) {
238
- return ts . createTempVariable ( context . hoistVariableDeclaration ) ;
239
+ const id = ts . createFileLevelUniqueName ( '$c' + uniqueName ++ ) ;
240
+ context . hoistVariableDeclaration ( id ) ;
241
+ return id ;
239
242
}
240
243
/**
241
244
* ! This function does not consider variable shadowing !
You can’t perform that action at this time.
0 commit comments