File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed 
docs/src/modules/components Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ const iframeDefaultJoyTheme = extendTheme({
2121  cssVarPrefix : 'demo-iframe' , 
2222} ) ; 
2323
24+ let  globalInjectThemeCache ; 
25+ 
2426function  FramedDemo ( props )  { 
2527  const  {  children,  document,  usesCssVarsTheme }  =  props ; 
2628
@@ -208,11 +210,13 @@ function DemoSandbox(props) {
208210  useEnhancedEffect ( ( )  =>  { 
209211    async  function  setupMaterialUITheme ( )  { 
210212      if  ( typeof  window . getInjectTheme  ===  'function' )  { 
211-         window . React  =  React ; 
212-         const  jsx  =  await  import ( 'react/jsx-runtime' ) ; 
213-         window . jsx  =  jsx ; 
214-         const  themeOptions  =  window . getInjectTheme ( ) ; 
215-         setInjectTheme ( themeOptions ) ; 
213+         if  ( ! globalInjectThemeCache )  { 
214+           window . React  =  React ; 
215+           const  jsx  =  await  import ( 'react/jsx-runtime' ) ; 
216+           window . jsx  =  jsx ; 
217+           globalInjectThemeCache  =  window . getInjectTheme ( ) ; 
218+         } 
219+         setInjectTheme ( globalInjectThemeCache ) ; 
216220      } 
217221    } 
218222    setupMaterialUITheme ( ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments