Skip to content

Commit

Permalink
Fix selector
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 16, 2020
1 parent 3bc22e5 commit e071288
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/block-editor/src/components/block-list/breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,16 @@ import BlockTitle from '../block-title';
* @return {WPComponent} The component to be rendered.
*/
function BlockBreadcrumb( { clientId, rootClientId, moverDirection, ...props } ) {
function selector( select ) {
const selected = useSelect( ( select ) => {
const {
__unstableGetBlockWithoutInnerBlocks,
getBlockIndex,
} = select( 'core/block-editor' );
const index = getBlockIndex( clientId, rootClientId );
const { name, attributes } = __unstableGetBlockWithoutInnerBlocks( clientId );
return { index, name, attributes };
}

const {
index,
name,
attributes,
} = useSelect( selector, [ clientId, rootClientId ] );
}, [ clientId, rootClientId ] );
const { index, name, attributes } = selected;
const {
setNavigationMode,
removeBlock,
Expand Down

0 comments on commit e071288

Please sign in to comment.