From 9ffdabbb7760e7db2ff3fc25520f88baddf0be0f Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 7 Nov 2024 10:46:07 +0100 Subject: [PATCH] Block Editor: Fix React Compiler error for 'BlockProps' util (#66809) Co-authored-by: Mamaduka Co-authored-by: tyxla --- packages/block-editor/src/hooks/utils.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/hooks/utils.js b/packages/block-editor/src/hooks/utils.js index fa710fa7f08eb..4334f70b9d13b 100644 --- a/packages/block-editor/src/hooks/utils.js +++ b/packages/block-editor/src/hooks/utils.js @@ -562,8 +562,13 @@ export function createBlockEditFilter( features ) { addFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks ); } -function BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) { - const wrapperProps = useBlockProps( props ); +function BlockProps( { + index, + useBlockProps: hook, + setAllWrapperProps, + ...props +} ) { + const wrapperProps = hook( props ); const setWrapperProps = ( next ) => setAllWrapperProps( ( prev ) => { const nextAll = [ ...prev ];