Skip to content

Commit

Permalink
Quote: Restore value map with defined default
Browse files Browse the repository at this point in the history
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: facebook/react#7038
  • Loading branch information
aduth committed Aug 10, 2017
1 parent 1df74df commit f1952ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blocks/library/quote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ registerBlockType( 'core/quote', {
value: {
type: 'array',
source: query( 'blockquote > p', node() ),
default: [],
},
citation: {
type: 'array',
Expand Down Expand Up @@ -204,7 +205,9 @@ registerBlockType( 'core/quote', {
className={ `blocks-quote-style-${ style }` }
style={ { textAlign: align ? align : null } }
>
{ value }
{ value.map( ( paragraph, i ) => (
<p key={ i }>{ paragraph.props.children }</p>
) ) }
{ citation && citation.length > 0 && (
<footer>{ citation }</footer>
) }
Expand Down

0 comments on commit f1952ac

Please sign in to comment.