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 => {
1818 // this scenario, the window is not available. We can't create a Unity
1919 // Loader in this case.
2020 if ( isBrowserEnvironment === false ) {
21- return ;
21+ return undefined ;
2222 }
2323 // If the script's source is null, we'll reset the status to idle.
2424 if ( unityConfig . loaderUrl === null ) {
2525 setStatus ( UnityLoaderStatus . Idle ) ;
26- return ;
26+ return undefined ;
2727 }
2828 /**
2929 * Find existing script element by source. It may have been added by
@@ -78,7 +78,7 @@ const useUnityLoader = (unityConfig: UnityConfig): UnityLoaderStatus => {
7878 if ( script !== null ) {
7979 script . removeEventListener ( "load" , setStateFromEvent ) ;
8080 script . removeEventListener ( "error" , setStateFromEvent ) ;
81- window . document . body . removeChild ( script ) ;
81+ script . remove ( ) ;
8282 }
8383 } ;
8484 } , [ unityConfig . loaderUrl ] ) ;
You can’t perform that action at this time.
0 commit comments