Created
July 10, 2018 19:06
-
-
Save belcherj/dd51b1f0d430861e43f9de64876edb51 to your computer and use it in GitHub Desktop.
InnerBlocks Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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> | |
| ); | |
| }, | |
| } ); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
const TEMPLATE = [ 'core/paragraph', {} ]; should be const TEMPLATE = [ [ 'core/paragraph', {} ] ];