From bef37f6ae4168f5aa55f6087fe8e1e41e68875ea Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 8 Feb 2024 12:12:25 +0400 Subject: [PATCH] Block Bindings: Remove unneeded 'setAttributes' override --- .../src/hooks/use-bindings-attributes.js | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/packages/block-editor/src/hooks/use-bindings-attributes.js b/packages/block-editor/src/hooks/use-bindings-attributes.js index c6c847cbddcd1..680e331d1da5a 100644 --- a/packages/block-editor/src/hooks/use-bindings-attributes.js +++ b/packages/block-editor/src/hooks/use-bindings-attributes.js @@ -3,7 +3,7 @@ */ import { getBlockType } from '@wordpress/blocks'; import { createHigherOrderComponent } from '@wordpress/compose'; -import { useRegistry, useSelect } from '@wordpress/data'; +import { useSelect } from '@wordpress/data'; import { addFilter } from '@wordpress/hooks'; /** * Internal dependencies @@ -36,8 +36,7 @@ const createEditFunctionWithBindingsAttribute = () => const { getBlockBindingsSource } = unlock( useSelect( blockEditorStore ) ); - const { getBlockAttributes, updateBlockAttributes } = - useSelect( blockEditorStore ); + const { getBlockAttributes } = useSelect( blockEditorStore ); const updatedAttributes = getBlockAttributes( clientId ); if ( updatedAttributes?.metadata?.bindings ) { @@ -80,21 +79,12 @@ const createEditFunctionWithBindingsAttribute = () => ); } - const registry = useRegistry(); - return ( - <> - - registry.batch( () => - updateBlockAttributes( blockId, newAttributes ) - ) - } - { ...props } - /> - + ); }, 'useBoundAttributes'