Neat implementation 🙂
The issue responsible for that error is here:
const [template, setTemplate] = useState([
["core/heading", { placeholder: "Three CTA Block" }],
["core/columns", {}, [...column]],
])
As well as here:
setTemplate([
["core/heading", { placeholder: "Three CTA Block" }],
["core/columns", {}, [...newColumn]],
])
If present, the third element of a block template block item array is supposed to be an array of inner block item arrays, but in both cases above you’re spreading the contents of a single block item into the inner blocks container.
The block name "r" in the error message is a product of the block template API attempting to treat the characters in the string "core/column" as a block item array:
I think the proper solution is to just remove the array spread operator in both cases.
Related Posts:
- lodash dependency in a Gutenberg plugin
- creating elements/innerblocks via rangecontrol
- Looking for callback function after Gutenberg is rendered?
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Make a list with header and subtext in Gutenberg blocks
- Gutenberg – What is the best way to save/update post meta?
- How to prevent UNDO on guternberg block editor
- Do I have to worry about useState causing a re-render?
- Creating a custom Gutenberg block with columns
- Gutenberg: import dependency or assign from global variable?
- How to control an elements classes from multiple Gutenberg sidebar controls?
- Developing the save function in Gutenberg blocks
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- What happens/fires when you select a block in the editor?
- Is “document loaded” different on admin side than public side?
- How to use setAttributes outside of the edit function return
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- Reading plugin settings in esnext wordpress block
- How can i add insertion point between inner blocks in my custom block like core blocks
- Reinitiate Gutenburg’s blocks using javascript
- Insert text programmatically in WordPress Gutenberg Editor
- Javascript function defined in view.js not reachable from save.js
- How to move custom gutenberg block controls from settings to styles tab?
- How to use useSelect to retrieve the currently default fontFamily?
- Event when Modal is opened/visible
- useBlockProps() nests wrapper with class name inside block wrapper in the editor
- Is It Possible to Use the Block Editor’s Notification Feature to Send Another Notification After the Post Is Saved?
- Custom action button in Gutenberg editor (post_submitbox_misc_actions – equivalent)
- How to provide translations for a WordPress TinyMCE plugin?
- How-to implement admin Ajax inside an admin WP_List_Table?
- Include third party Javascript library which is not included in WordPress
- Create Element From Dynamic HTML String [closed]
- The changes I make to an external JS file of my WP plugin are only applied after I clear my browser’s cache
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- How to Parse an Array of Elements in Gutenberg Block
- Gutenberg registerFormatType with Multiple Classes
- Passing RichText attributes to function onChange
- Print WordPress username id inside JavaScript
- Mixing Regular Javascript With jQuery in a Plugin
- How to create multiple Gutenberg blocks in one plugin
- How to get color name in PanelColorSettings in custom Gutenberg block?
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Where to call wp_enqueue_script in a plugin with custom template?
- Is there an additional block.json property to set to get an InnerBlocks child to respect the “supports” property?
- How to setAttributes in Gutenberg block?
- How to override gutenberg paragraph block edit property
- What’s the right way to instantiate new blocks and/or the plugin itself in toto when using wppb architecture?
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- How can I get the selected string when using a toolbar button in Gutenberg?
- wp.template() returns tags in Ajax response
- How can I avoid conflicts between plugin and theme?
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- How to add a gradient component to a custom block
- How to only load css for used blocks on frontend
- Translate javascript with WordPress built-in localization API for static strings
- Invalid hook call on save, not edit when using swiper slider
- Insert Into Post Not Working For Audio File Using jQuery
- Modify custom block plugin without losing content
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- How to override supports of innerBlocks?
- wp.media libary pdf type
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- extraprops override existing props
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- WPGut – Updating failed and shortcode?
- Fixed: Console.log twice in the edit function
- Gutenberg – Call google map render function in save after DOM has been rendered
- converting a node.js project into a wp plugin
- Where do I hook to have the server do something in PHP on block attribute change?
- WordPress with React: Saving and Using Data Collected with fetch
- How to integrate plugins into block editor
- How to get access the ID of all posts of custom post type in Gutenberg editor
- How to create save function for custom Gutenberg style block?
- Using JavaScript in WordPress page to call for server data using AJAX
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- Uncaught ReferenceError: kpoejy is not defined
- Remove from a div by class name from post page if post author role is not administrator
- On one of my sites a file is shown as 404 but the file IS there
- How react js and other Javascript Technologies works on WordPress plugin?
- Render raw html in Gutenberg block
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Build a dynamic block using the default attributes
- Add custom data-attribute to core Gutenberg block within an template
- How to replace content of a block in and re-render on change?
- extending a core block doesn’t work inside the editor
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development
- how to add contact form 7 shortcode in javascript variable
- Remove Gutenberg Buttons Block
- WordPress 6.6.1 – Trying to make a block but receive error, “! Cannot read property ‘then’ of undefined”
- Template locked block does not show appender
- Multiple php files in dynamic gutenberg block
- Gutenberg Static blocks: viewScript doesn’t import css for frontend?
- Custom Gutenberg block with nested InnerBlocks renderAppender not displaying add button
- Can we write custom DOM manipulation inside edit.js file while developing custom Gutenberg block?
- User set default settings for a Block in Site Editor
- how to include an image in the build of a multi block plugin
