Skip to content

Commit

Permalink
Block Editor: Fix React Compiler error for 'BlockProps' util (#66809)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2024
1 parent 69f71e1 commit 7874fc5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/block-editor/src/hooks/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down

0 comments on commit 7874fc5

Please sign in to comment.