From 1bdd0f4e132f2f7edb5ca38ea2400a4f2314392a Mon Sep 17 00:00:00 2001 From: Zebulan Stanphill Date: Tue, 19 May 2020 13:31:20 -0500 Subject: [PATCH] Use __experimentalGetParsedReusableBlock. --- packages/block-library/src/block/edit.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/block/edit.js b/packages/block-library/src/block/edit.js index 0a8fdc1eb469d0..d1a37b0f2dbb21 100644 --- a/packages/block-library/src/block/edit.js +++ b/packages/block-library/src/block/edit.js @@ -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'; @@ -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, @@ -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 &&