From 1bf76ccbdaac86a6188270d0825b8ae510422e41 Mon Sep 17 00:00:00 2001 From: Mario Santos <34552881+SantosGuillamot@users.noreply.github.com> Date: Wed, 25 Sep 2024 19:18:53 +0200 Subject: [PATCH] Only pass usesContext properties to block bindings editor APIs (#65661) Co-authored-by: SantosGuillamot Co-authored-by: gziolo --- packages/block-editor/src/hooks/use-bindings-attributes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/hooks/use-bindings-attributes.js b/packages/block-editor/src/hooks/use-bindings-attributes.js index 9f9234ad47d10..0fb8c38ce28d3 100644 --- a/packages/block-editor/src/hooks/use-bindings-attributes.js +++ b/packages/block-editor/src/hooks/use-bindings-attributes.js @@ -117,7 +117,7 @@ export const withBlockBindingSupport = createHigherOrderComponent( // used purposely here to ensure `boundAttributes` is updated whenever // there are attribute updates. // `source.getValues` may also call a selector via `registry.select`. - const updatedContext = { ...context }; + const updatedContext = {}; const boundAttributes = useSelect( () => { if ( ! blockBindings ) { return; @@ -285,7 +285,7 @@ export const withBlockBindingSupport = createHigherOrderComponent( { ...props } attributes={ { ...props.attributes, ...boundAttributes } } setAttributes={ _setAttributes } - context={ updatedContext } + context={ { ...context, ...updatedContext } } /> );