Skip to content

Commit

Permalink
Use __experimentalGetParsedReusableBlock.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebulanStanphill committed Jul 17, 2020
1 parent 1c46b25 commit 1bdd0f4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
BlockList,
WritingFlow,
} from '@wordpress/block-editor';
import { parse, serialize } from '@wordpress/blocks';
import { serialize } from '@wordpress/blocks';
import { Placeholder, Spinner, Disabled } from '@wordpress/components';
import { useDispatch, useSelect } from '@wordpress/data';
import { useEffect, useState } from '@wordpress/element';
Expand All @@ -37,7 +37,10 @@ export default function ReusableBlockEdit( { attributes, isSelected } ) {
} = useSelect(
( select ) => {
const { canUser } = select( 'core' );
const { getSettings } = select( 'core/block-editor' );
const {
__experimentalGetParsedReusableBlock: getParsedReusableBlock,
getSettings,
} = select( 'core/block-editor' );
const {
__experimentalGetReusableBlock: getReusableBlock,
__experimentalIsFetchingReusableBlock: isFetchingReusableBlock,
Expand All @@ -50,7 +53,9 @@ export default function ReusableBlockEdit( { attributes, isSelected } ) {
isFetching: isFetchingReusableBlock( ref ),
isSaving: isSavingReusableBlock( ref ),
isTemporary: _reusableBlock?.isTemporary ?? null,
blocks: _reusableBlock ? parse( _reusableBlock.content ) : null,
blocks: _reusableBlock
? getParsedReusableBlock( _reusableBlock.id )
: null,
canUpdateBlock:
!! _reusableBlock &&
! _reusableBlock.isTemporary &&
Expand Down

0 comments on commit 1bdd0f4

Please sign in to comment.