Skip to content

Commit

Permalink
use useEnhancedEffect instead
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Aug 1, 2024
1 parent 8eda402 commit a69ab7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/modules/components/DemoSandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import DemoErrorBoundary from 'docs/src/modules/components/DemoErrorBoundary';
import { useTranslate } from '@mui/docs/i18n';
import { getDesignTokens } from '@mui/docs/branding';
import { highDensity } from 'docs/src/modules/components/ThemeContext';
import { deepmerge } from '@mui/utils';
import { deepmerge, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';

const iframeDefaultJoyTheme = extendTheme({
cssVarPrefix: 'demo-iframe',
Expand Down Expand Up @@ -205,7 +205,7 @@ function DemoSandbox(props) {
// `childrenProp` needs to be a child of `Sandbox` since the iframe implementation rely on `cloneElement`.
const children = <Sandbox {...sandboxProps}>{childrenProp}</Sandbox>;

React.useLayoutEffect(() => {
useEnhancedEffect(() => {
async function setupMaterialUITheme() {
if (typeof window.getInjectTheme === 'function') {
window.React = React;
Expand Down

0 comments on commit a69ab7f

Please sign in to comment.