Skip to content

Commit

Permalink
Block Editor: Fix the issue with block style preview when example mis…
Browse files Browse the repository at this point in the history
…sing (#29894)
  • Loading branch information
gziolo authored Mar 16, 2021
1 parent 642f2c5 commit 5acf1e9
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ import {
import BlockStyles from '../block-styles';
import PreviewBlockPopover from './preview-block-popover';

export default function BlockStylesMenu( {
hoveredBlock: { name, clientId },
onSwitch,
} ) {
export default function BlockStylesMenu( { hoveredBlock, onSwitch } ) {
const { name, clientId } = hoveredBlock;
const [ hoveredClassName, setHoveredClassName ] = useState();
const blockType = useSelect(
( select ) => select( blocksStore ).getBlockType( name ),
Expand All @@ -43,7 +41,7 @@ export default function BlockStylesMenu( {
},
innerBlocks: blockType.example.innerBlocks,
} )
: cloneBlock( blockType, {
: cloneBlock( hoveredBlock, {
className: hoveredClassName,
} )
}
Expand Down

0 comments on commit 5acf1e9

Please sign in to comment.