From f1952ac5e06ae077c90929bd6d3e36ad0fa2e557 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Thu, 10 Aug 2017 11:48:17 -0400 Subject: [PATCH] Quote: Restore value map with defined default Needed to ensure key is assigned into map result to avoid React error. Seems unnecessary since we don't need the diffing reconciliation for generating static markup, but alas. See: https://github.com/facebook/react/issues/7038 --- blocks/library/quote/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blocks/library/quote/index.js b/blocks/library/quote/index.js index d717ce92b590a..8138a08f81f63 100644 --- a/blocks/library/quote/index.js +++ b/blocks/library/quote/index.js @@ -29,6 +29,7 @@ registerBlockType( 'core/quote', { value: { type: 'array', source: query( 'blockquote > p', node() ), + default: [], }, citation: { type: 'array', @@ -204,7 +205,9 @@ registerBlockType( 'core/quote', { className={ `blocks-quote-style-${ style }` } style={ { textAlign: align ? align : null } } > - { value } + { value.map( ( paragraph, i ) => ( +

{ paragraph.props.children }

+ ) ) } { citation && citation.length > 0 && ( ) }