diff --git a/packages/block-editor/src/components/block-list/block.native.js b/packages/block-editor/src/components/block-list/block.native.js index 1c0de681bd4c2..818fc6e1a9900 100644 --- a/packages/block-editor/src/components/block-list/block.native.js +++ b/packages/block-editor/src/components/block-list/block.native.js @@ -48,6 +48,7 @@ import { store as blockEditorStore } from '../../store'; import { useLayout } from './layout'; import useScrollUponInsertion from './use-scroll-upon-insertion'; import { useSettings } from '../use-settings'; +import { unlock } from '../../lock-unlock'; const EMPTY_ARRAY = []; @@ -418,11 +419,13 @@ const applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => { getBlockMode, isSelectionEnabled, getTemplateLock, - __unstableGetBlockWithoutInnerBlocks, + getBlockWithoutAttributes, + getBlockAttributes, canRemoveBlock, canMoveBlock, - } = select( blockEditorStore ); - const block = __unstableGetBlockWithoutInnerBlocks( clientId ); + } = unlock( select( blockEditorStore ) ); + const block = getBlockWithoutAttributes( clientId ); + const attributes = getBlockAttributes( clientId ); const isSelected = isBlockSelected( clientId ); const templateLock = getTemplateLock( rootClientId ); const canRemove = canRemoveBlock( clientId, rootClientId ); @@ -432,7 +435,7 @@ const applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => { // This function should never be called when a block is not present in // the state. It happens now because the order in withSelect rendering // is not correct. - const { name, attributes, isValid } = block || {}; + const { name, isValid } = block || {}; // Do not add new properties here, use `useSelect` instead to avoid // leaking new props to the public API (editor.BlockListBlock filter).