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
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- check if Gutenberg is currently in use
- How to use PanelColorSettings in custom Gutenberg block?
- Custom action button in Gutenberg editor (post_submitbox_misc_actions – equivalent)
- How to provide translations for a WordPress TinyMCE plugin?
- Include third party Javascript library which is not included in WordPress
- Hook the Keydown Event in the TinyMCE Post Editor
- How to save block attributes when the output doesn’t change
- How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg
- Gutenberg ServerSideRender is deprecated, how to work with new wp.serverSideRender component?
- Create Element From Dynamic HTML String [closed]
- `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
- Can’t get JS code to work with shortcode
- Using the component outside the editor. select(‘core’) is null
- Gutenberg is there a way to know if the current block is reusable?
- How to allow core Gutenberg blocks selection only when you are inside a custom inner block
- Gutenberg registerFormatType with Multiple Classes
- How do I add a javascript file to all admin pages via a plugin?
- Saving data from block editor to the database
- How do I store information in a dynamic block in WordPress?
- 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?
- Gutenberg Block showing invalid content on edit
- Gutenberg blocks not getting styled on back end
- WordPress Plugin with a shortcode that dynamically generates javascript. Can I use add_action without wrapping the javascript in a function?
- How to setAttributes in Gutenberg block?
- Best way to save custom css for an block
- How can I listen to events in Gutenberg block?
- It’s possible to passing a ref to FormTokenField from parent component using forwardRef?
- What’s the right way to instantiate new blocks and/or the plugin itself in toto when using wppb architecture?
- WP Gutenberg Blocks – How to limit first/root blocks
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- add javascript files only when plugin is called?
- Gutenberg table block with Bootstrap .table class
- 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
- How to add template colors to custom block options in WordPress Gutenberg editor sidebar?
- Insert Into Post Not Working For Audio File Using jQuery
- How to properly package a block plugin
- Modify custom block plugin without losing content
- 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
- Query String Filtering API
- How to extend SelectControl with data from my theme
- extraprops override existing props
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- Gutenberg – Call google map render function in save after DOM has been rendered
- converting a node.js project into a wp plugin
- How to re-render inspector controls?
- Load script on frontend from widget plugin
- WordPress with React: Saving and Using Data Collected with fetch
- How to integrate plugins into block editor
- Add custom html classes to gutenberg wrapper
- How to create save function for custom Gutenberg style block?
- Using JavaScript in WordPress page to call for server data using AJAX
- Uncaught ReferenceError: kpoejy is not defined
- On one of my sites a file is shown as 404 but the file IS there
- Gutenberg and custom blocks messed up pagespeed score. What did I wrong?
- Gutenberg text field validation
- Undo operation not working in Rich text [Gutenberg]
- 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
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- 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