From fbac29b09913c60f3004eb979542f851daf87f7a Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:41:20 +1100 Subject: [PATCH] Post Template Block: Move inner blocks container to separate component (#35945) --- packages/block-library/src/post-template/edit.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/post-template/edit.js b/packages/block-library/src/post-template/edit.js index c5d808509d72c2..75c7046eba142c 100644 --- a/packages/block-library/src/post-template/edit.js +++ b/packages/block-library/src/post-template/edit.js @@ -24,6 +24,12 @@ const TEMPLATE = [ [ 'core/post-date' ], [ 'core/post-excerpt' ], ]; + +function PostTemplateInnerBlocks() { + const innerBlocksProps = useInnerBlocksProps( {}, { template: TEMPLATE } ); + return
; +} + export default function PostTemplateEdit( { clientId, context: { @@ -125,7 +131,6 @@ export default function PostTemplateEdit( { [ `columns-${ columns }` ]: hasLayoutFlex, } ), } ); - const innerBlocksProps = useInnerBlocksProps( {}, { template: TEMPLATE } ); if ( ! posts ) { return ( @@ -149,7 +154,7 @@ export default function PostTemplateEdit( { > { blockContext === ( activeBlockContext || blockContexts[ 0 ] ) ? ( - +