Skip to content

Commit

Permalink
Remove unecessary clone of Blocks
Browse files Browse the repository at this point in the history
Not sure why this was introduced.
  • Loading branch information
getdave authored and marekhrabe committed Jul 30, 2019
1 parent 17bab95 commit 74f4a0c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/block-editor/src/components/block-preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { createBlock } from '@wordpress/blocks';
import { Disabled } from '@wordpress/components';
import { withSelect } from '@wordpress/data';

Expand Down Expand Up @@ -35,15 +34,10 @@ export function BlockPreviewContent( { blocks, settings } ) {

const theBlocks = Array.isArray( blocks ) ? blocks : [ blocks ];

// Create new "clone" Blocks to show in the preview
const blocksToPreview = theBlocks.map( ( { name, attributes, innerBlocks } ) => {
return createBlock( name, attributes, innerBlocks );
} );

return (
<Disabled className="editor-block-preview__content block-editor-block-preview__content editor-styles-wrapper" aria-hidden>
<BlockEditorProvider
value={ blocksToPreview }
value={ theBlocks }
settings={ settings }
>
<BlockList />
Expand Down

0 comments on commit 74f4a0c

Please sign in to comment.