Skip to content

Commit

Permalink
Block Editor: Fix React Compiler error for 'BlockProps' util (WordPre…
Browse files Browse the repository at this point in the history
…ss#66809)


Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
3 people authored and karthick-murugan committed Nov 13, 2024
1 parent 386825b commit 9ffdabb
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 9ffdabb

Please sign in to comment.