File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ const useUnityLoader = (unityConfig: UnityConfig): UnityLoaderStatus => {
18
18
// this scenario, the window is not available. We can't create a Unity
19
19
// Loader in this case.
20
20
if ( isBrowserEnvironment === false ) {
21
- return ;
21
+ return undefined ;
22
22
}
23
23
// If the script's source is null, we'll reset the status to idle.
24
24
if ( unityConfig . loaderUrl === null ) {
25
25
setStatus ( UnityLoaderStatus . Idle ) ;
26
- return ;
26
+ return undefined ;
27
27
}
28
28
/**
29
29
* Find existing script element by source. It may have been added by
@@ -78,7 +78,7 @@ const useUnityLoader = (unityConfig: UnityConfig): UnityLoaderStatus => {
78
78
if ( script !== null ) {
79
79
script . removeEventListener ( "load" , setStateFromEvent ) ;
80
80
script . removeEventListener ( "error" , setStateFromEvent ) ;
81
- window . document . body . removeChild ( script ) ;
81
+ script . remove ( ) ;
82
82
}
83
83
} ;
84
84
} , [ unityConfig . loaderUrl ] ) ;
You can’t perform that action at this time.
0 commit comments