Answers for "Example code of using inner blocks in Wordpress with ESNext"

0

Example code of using inner blocks in Wordpress with ESNext

import { registerBlockType } from '@wordpress/blocks';
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
 
registerBlockType( 'softhunt/inner-example', {
    // ...
 
    edit: () => {
        const blockProps = useBlockProps();
 
        return (
            <div { ...blockProps }>
                <InnerBlocks />
            </div>
        );
    },
 
    save: () => {
        const blockProps = useBlockProps.save();
 
        return (
            <div { ...blockProps }>
                <InnerBlocks.Content />
            </div>
        );
    },
} );
Posted by: Guest on April-10-2022

Code answers related to "Example code of using inner blocks in Wordpress with ESNext"

Code answers related to "Javascript"

Browse Popular Code Answers by Language