From f5afc52e5b5f5b6efb4eacea5f80a9c94f616754 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 21 May 2024 17:33:52 +0400 Subject: [PATCH] useBlockInspectorAnimationSettings: Remove unnecessary deps --- .../block-editor/src/components/block-inspector/index.js | 6 ++---- .../block-inspector/useBlockInspectorAnimationSettings.js | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/block-editor/src/components/block-inspector/index.js b/packages/block-editor/src/components/block-inspector/index.js index 6da035a883ffb1..e01cd095752696 100644 --- a/packages/block-editor/src/components/block-inspector/index.js +++ b/packages/block-editor/src/components/block-inspector/index.js @@ -111,10 +111,8 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { // displays based on the relationship between the selected block // and its parent, and only enable it if the parent is controlling // its children blocks. - const blockInspectorAnimationSettings = useBlockInspectorAnimationSettings( - blockType, - selectedBlockClientId - ); + const blockInspectorAnimationSettings = + useBlockInspectorAnimationSettings( blockType ); const borderPanelLabel = useBorderPanelLabel( { blockName: selectedBlockName, diff --git a/packages/block-editor/src/components/block-inspector/useBlockInspectorAnimationSettings.js b/packages/block-editor/src/components/block-inspector/useBlockInspectorAnimationSettings.js index 6be7d3fe18667e..d89639c4b9ac8c 100644 --- a/packages/block-editor/src/components/block-inspector/useBlockInspectorAnimationSettings.js +++ b/packages/block-editor/src/components/block-inspector/useBlockInspectorAnimationSettings.js @@ -8,10 +8,7 @@ import { useSelect } from '@wordpress/data'; */ import { store as blockEditorStore } from '../../store'; -export default function useBlockInspectorAnimationSettings( - blockType, - selectedBlockClientId -) { +export default function useBlockInspectorAnimationSettings( blockType ) { return useSelect( ( select ) => { if ( blockType ) { @@ -48,6 +45,6 @@ export default function useBlockInspectorAnimationSettings( } return null; }, - [ selectedBlockClientId, blockType ] + [ blockType ] ); }