Skip to content

Commit

Permalink
Site Editor: Memoize sidebar component (#46604)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Dec 16, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 6888113 commit ff9ec58
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
@@ -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';
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';

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

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

export default memo( Sidebar );

1 comment on commit ff9ec58

@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/3711923123
📝 Reported issues:

Please sign in to comment.