From 5678a1d1cdb98270631dbf65b927bdb12c16b0f9 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 26 Oct 2021 17:23:30 +1100 Subject: [PATCH] Post Template Block: Move inner blocks container to separate component --- 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 c5d808509d72c..75c7046eba142 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 ] ) ? ( -
  • + ) : (