diff --git a/packages/block-editor/src/components/iframe/index.js b/packages/block-editor/src/components/iframe/index.js index b00e93f5d569c6..b1d258ffc9ec87 100644 --- a/packages/block-editor/src/components/iframe/index.js +++ b/packages/block-editor/src/components/iframe/index.js @@ -217,8 +217,8 @@ function Iframe( { }, [] ); const { - contentRefCallback, - containerRefCallback, + contentRef: scaleContentRef, + containerRef, isZoomedOut, scaleContainerWidth, } = useScaleCanvas( { @@ -234,7 +234,7 @@ function Iframe( { clearerRef, writingFlowRef, disabledRef, - contentRefCallback, + scaleContentRef, ] ); // Correct doctype is required to enable rendering in standards @@ -354,10 +354,7 @@ function Iframe( { ); return ( -
+
} contentRef A callback ref to the content element. + * @property {import('react').Ref} containerRef A callback ref to the container element. */ /** @@ -180,14 +180,14 @@ export function useScaleCanvas( { scale, } ) { const [ { height: contentHeight }, setContentRect ] = useState( NULL_SIZE ); - const contentRefCallback = useResizeObserver( ( entries ) => { + const contentRef = useResizeObserver( ( entries ) => { setContentRect( extractSize( entries ) ); } ); const [ { width: containerWidth, height: containerHeight }, setContainerRect, ] = useState( NULL_SIZE ); - const containerRefCallback = useResizeObserver( ( entries ) => { + const containerRef = useResizeObserver( ( entries ) => { setContainerRect( extractSize( entries ) ); } ); @@ -511,7 +511,7 @@ export function useScaleCanvas( { return { isZoomedOut, scaleContainerWidth, - contentRefCallback, - containerRefCallback, + contentRef, + containerRef, }; }