From a44711dd5aed218e56fde76c09e0f087fcee2c9d Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Mon, 27 Oct 2025 14:33:51 -0500 Subject: [PATCH] Switch from selector to useBlockEditingMode for AllowedBlocksControl --- packages/block-editor/src/hooks/allowed-blocks.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/block-editor/src/hooks/allowed-blocks.js b/packages/block-editor/src/hooks/allowed-blocks.js index 207177cdc96bfb..d1af7b74adf739 100644 --- a/packages/block-editor/src/hooks/allowed-blocks.js +++ b/packages/block-editor/src/hooks/allowed-blocks.js @@ -3,25 +3,17 @@ */ import { addFilter } from '@wordpress/hooks'; import { hasBlockSupport } from '@wordpress/blocks'; -import { useSelect } from '@wordpress/data'; /** * Internal dependencies */ -import { store as blockEditorStore } from '../store'; import { PrivateInspectorControlsAllowedBlocks } from '../components/inspector-controls/groups'; import BlockAllowedBlocksControl from '../components/block-allowed-blocks/allowed-blocks-control'; +import { useBlockEditingMode } from '../components/block-editing-mode'; function BlockEditAllowedBlocksControlPure( { clientId } ) { - const isContentOnly = useSelect( - ( select ) => { - return ( - select( blockEditorStore ).getBlockEditingMode( clientId ) === - 'contentOnly' - ); - }, - [ clientId ] - ); + const blockEditingMode = useBlockEditingMode(); + const isContentOnly = blockEditingMode === 'contentOnly'; if ( isContentOnly ) { return null;