Skip to content

Commit

Permalink
Site Editor: Memoize sidebar component
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Dec 16, 2022
1 parent 6888113 commit 710e24c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
/**
* Internal dependencies
*/
import { Sidebar } from '../sidebar';
import Sidebar from '../sidebar';
import Editor from '../editor';
import ListPage from '../list';
import ErrorBoundary from '../error-boundary';
Expand Down
5 changes: 4 additions & 1 deletion packages/edit-site/src/components/sidebar/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* WordPress dependencies
*/
import { memo } from '@wordpress/element';
import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';

/**
Expand All @@ -22,7 +23,7 @@ function SidebarScreens() {
);
}

export function Sidebar() {
function Sidebar() {
return (
<NavigatorProvider
className="edit-site-sidebar__content"
Expand All @@ -32,3 +33,5 @@ export function Sidebar() {
</NavigatorProvider>
);
}

export default memo( Sidebar );

1 comment on commit 710e24c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3711555841
📝 Reported issues:

Please sign in to comment.