From 0dc010bad71399c3b2beec7f670fed8a4ea48026 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 17 Apr 2017 09:34:19 +0100 Subject: [PATCH] Using the create block helper --- blocks/library/text/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/blocks/library/text/index.js b/blocks/library/text/index.js index 6e36541d186c7f..5c86885e8cdb4a 100644 --- a/blocks/library/text/index.js +++ b/blocks/library/text/index.js @@ -60,13 +60,9 @@ registerBlock( 'core/text', { style={ align ? { textAlign: align } : null } onSplit={ ( before, after ) => { setAttributes( { content: before } ); - insertBlockAfter( { - uid: uuid(), - blockType: 'core/text', - attributes: { - content: after - } - } ); + insertBlockAfter( wp.blocks.createBlock( 'core/text', { + content: after + } ) ); } } /> );