Skip to content

Commit

Permalink
Block Editor: Fix 'useInstanceId' hook reference (#66406)
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 Oct 24, 2024
1 parent a7e59f9 commit 20e10fe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/block-editor/src/hooks/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,14 @@ const elementTypes = [
},
];

// Used for generating the instance ID
const STYLE_BLOCK_PROPS_REFERENCE = {};

function useBlockProps( { name, style } ) {
const blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(
useBlockProps
) }`;
const blockElementsContainerIdentifier = useInstanceId(
STYLE_BLOCK_PROPS_REFERENCE,
'wp-elements'
);

const baseElementSelector = `.${ blockElementsContainerIdentifier }`;
const blockElementStyles = style?.elements;
Expand Down

0 comments on commit 20e10fe

Please sign in to comment.