By example, have a custom block with a title and RichText content, how to add the RichText block as element into my block?.
My JS code is:
wp.blocks.registerBlockType('custom-block/wrapped-content', {
title: 'Wrapped content',
icon: 'editor-textcolor',
category: 'common',
attributes: {
content: { type: 'array' }
},
edit: (props) => {
return wp.element.createElement('div',
{
class: 'wrapped container border rounded p-2'
},
wp.element.createElement(/* RichText here! */)
);
},
save: (props) => { }
});