Skip to content

Instantly share code, notes, and snippets.

@belcherj
Created July 10, 2018 19:06
Show Gist options
  • Select an option

  • Save belcherj/dd51b1f0d430861e43f9de64876edb51 to your computer and use it in GitHub Desktop.

Select an option

Save belcherj/dd51b1f0d430861e43f9de64876edb51 to your computer and use it in GitHub Desktop.
InnerBlocks Error
/**
* Internal dependencies
*/
import './style.scss';
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType, createBlock } from '@wordpress/blocks';
import { InnerBlocks } from '@wordpress/editor';
const TEMPLATE = [ 'core/paragraph', {} ];
const TEMPLATE2 = createBlock( 'core/paragraph' );
registerBlockType( 'woo/content-header', {
title: __( 'Content Header' ),
icon: 'universal-access-alt',
category: 'widgets',
edit() {
return (
<div>
<InnerBlocks template={ TEMPLATE } />
</div>
);
},
save() {
return (
<div>
<InnerBlocks.Content />
</div>
);
},
} );
@belcherj
Copy link
Author

const TEMPLATE = [ 'core/paragraph', {} ]; should be const TEMPLATE = [ [ 'core/paragraph', {} ] ];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment