diff --git a/packages/block-editor/src/components/list-view/block.js b/packages/block-editor/src/components/list-view/block.js index 307666feb23e5..8afe09a0d07ad 100644 --- a/packages/block-editor/src/components/list-view/block.js +++ b/packages/block-editor/src/components/list-view/block.js @@ -16,7 +16,7 @@ import { } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { moreVertical } from '@wordpress/icons'; -import { useState, useRef, useEffect, memo } from '@wordpress/element'; +import { useState, useRef, useEffect } from '@wordpress/element'; import { useDispatch, useSelect } from '@wordpress/data'; /** @@ -41,7 +41,7 @@ const ROW_VARIANTS = { }; const DRAG_CONSTANTS = { left: -10, right: 10 }; -function ListViewBlock( { +export default function ListViewBlock( { block, isSelected, isBranchSelected, @@ -334,16 +334,3 @@ function ListViewBlock( { ); } - -function shouldSkipUpdateIfDragging( prevProps, nextProps ) { - if ( prevProps.draggingId && nextProps.draggingId ) { - const samePosition = nextProps.listPosition === prevProps.listPosition; - const sameParent = nextProps.parentId === prevProps.parentId; - const expanded = nextProps.isExpanded === prevProps.isExpanded; - return samePosition && sameParent && expanded; - } - // If not dragging, default to native behavior of always rendering if the parent has rendered. - return false; -} - -export default memo( ListViewBlock, shouldSkipUpdateIfDragging ); diff --git a/packages/edit-post/src/components/secondary-sidebar/list-view-sidebar.js b/packages/edit-post/src/components/secondary-sidebar/list-view-sidebar.js index da93e77789cc4..617a22f9b7632 100644 --- a/packages/edit-post/src/components/secondary-sidebar/list-view-sidebar.js +++ b/packages/edit-post/src/components/secondary-sidebar/list-view-sidebar.js @@ -6,7 +6,6 @@ import { store as blockEditorStore, } from '@wordpress/block-editor'; import { Button } from '@wordpress/components'; -import { memo } from '@wordpress/element'; import { useFocusOnMount, useFocusReturn, @@ -23,7 +22,7 @@ import { ESCAPE } from '@wordpress/keycodes'; */ import { store as editPostStore } from '../../store'; -function ListViewSidebar() { +export default function ListViewSidebar() { const { setIsListViewOpened } = useDispatch( editPostStore ); const { clearSelectedBlock, selectBlock } = useDispatch( blockEditorStore ); @@ -72,4 +71,3 @@ function ListViewSidebar() { ); } -export default memo( ListViewSidebar ); diff --git a/packages/edit-site/src/components/secondary-sidebar/list-view-sidebar.js b/packages/edit-site/src/components/secondary-sidebar/list-view-sidebar.js index d58100188c260..469dabaff5619 100644 --- a/packages/edit-site/src/components/secondary-sidebar/list-view-sidebar.js +++ b/packages/edit-site/src/components/secondary-sidebar/list-view-sidebar.js @@ -12,7 +12,6 @@ import { useInstanceId, useMergeRefs, } from '@wordpress/compose'; -import { memo } from '@wordpress/element'; import { useDispatch } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; import { closeSmall } from '@wordpress/icons'; @@ -23,7 +22,7 @@ import { ESCAPE } from '@wordpress/keycodes'; */ import { store as editSiteStore } from '../../store'; -function ListViewSidebar() { +export default function ListViewSidebar() { const { setIsListViewOpened } = useDispatch( editSiteStore ); const { clearSelectedBlock, selectBlock } = useDispatch( blockEditorStore ); @@ -71,4 +70,3 @@ function ListViewSidebar() { ); } -export default memo( ListViewSidebar );