From 21e01677fe21acd9ea9baa8c850a8784e717e15b Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 14 Feb 2024 15:53:34 +0400 Subject: [PATCH] Site Editor: Don't memoize the canvas container title (#59000) Co-authored-by: Mamaduka Co-authored-by: tyxla --- .../src/components/editor-canvas-container/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/edit-site/src/components/editor-canvas-container/index.js b/packages/edit-site/src/components/editor-canvas-container/index.js index a6dc8b05409e22..09ae95989695d8 100644 --- a/packages/edit-site/src/components/editor-canvas-container/index.js +++ b/packages/edit-site/src/components/editor-canvas-container/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { Children, cloneElement, useState, useMemo } from '@wordpress/element'; +import { Children, cloneElement, useState } from '@wordpress/element'; import { Button, privateApis as componentsPrivateApis, @@ -82,10 +82,6 @@ function EditorCanvasContainer( { const focusOnMountRef = useFocusOnMount( 'firstElement' ); const sectionFocusReturnRef = useFocusReturn(); - const title = useMemo( - () => getEditorCanvasContainerTitle( editorCanvasContainerView ), - [ editorCanvasContainerView ] - ); function onCloseContainer() { setIsListViewOpened( showListViewByDefault ); @@ -119,6 +115,7 @@ function EditorCanvasContainer( { return null; } + const title = getEditorCanvasContainerTitle( editorCanvasContainerView ); const shouldShowCloseButton = onClose || closeButtonLabel; return (