From 50a5beff5c0b06a81f3b3d071e579936845bb6a7 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Fri, 18 Jun 2021 12:13:57 +0300 Subject: [PATCH] improve conditional template definition --- packages/block-library/src/buttons/edit.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/block-library/src/buttons/edit.js b/packages/block-library/src/buttons/edit.js index 812cbf8cc1615a..fb3a237584dbf7 100644 --- a/packages/block-library/src/buttons/edit.js +++ b/packages/block-library/src/buttons/edit.js @@ -52,14 +52,14 @@ function ButtonsEdit( { const innerBlocksProps = useInnerBlocksProps( blockProps, { allowedBlocks: ALLOWED_BLOCKS, - template: [ - [ - 'core/button', - preferredStyle - ? { className: `is-style-${ preferredStyle }` } - : {}, - ], - ], + template: preferredStyle + ? [ + [ + 'core/button', + { className: `is-style-${ preferredStyle }` }, + ], + ] + : [ [ 'core/button' ] ], orientation, __experimentalLayout: LAYOUT, templateInsertUpdatesSelection: true,