From 7a6050973f3839a481c4f373fd7d1352db50dfdc Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Thu, 12 Apr 2018 00:10:20 -0700 Subject: [PATCH] Use wp.element.Fragment instead of wrangling arrays with key props Props @gziolo --- assets/js/amp-block-validation.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/assets/js/amp-block-validation.js b/assets/js/amp-block-validation.js index 81e1b30a056..07591f98176 100644 --- a/assets/js/amp-block-validation.js +++ b/assets/js/amp-block-validation.js @@ -309,12 +309,11 @@ var ampBlockValidation = ( function() { * @return {Function} The edit() method, conditionally wrapped in a notice for AMP validation error(s). */ conditionallyAddNotice: function conditionallyAddNotice( BlockEdit ) { - function AmpNoticeBlockEdit( props, children ) { + function AmpNoticeBlockEdit( props ) { var edit, details; edit = wp.element.createElement( BlockEdit, - _.extend( {}, props, { key: 'amp-original-edit' } ), - children + props ); if ( 0 === props.ampBlockValidationErrors.length ) { @@ -340,18 +339,18 @@ var ampBlockValidation = ( function() { ) ] ); - return [ + return wp.element.createElement( + wp.element.Fragment, {}, wp.element.createElement( wp.components.Notice, { status: 'warning', - isDismissible: false, - key: 'amp-validation-notice' + isDismissible: false }, details ), edit - ]; + ); } return wp.data.withSelect( function( select, ownProps ) {