Do not wrap custom block in an additional DIV but instead use only the JSX I provide

Update: WordPress 5.6 will be released soon and this will include a block API version 2 which allows all these modifications noted in OP. https://make.wordpress.org/core/2020/11/18/block-api-version-2/ I found a filter that allows me to modify the wrapper. Still, I can’t change the HTML tag, but it’s better than nothing. const { createHigherOrderComponent } = wp.compose; const … Read more

Rebuilding core image block

I discovered that I used master branch of github where I took core/image block source. Obviously, useBlockProps is yet not part of the core (or not implemented in @wordpress/create-blocks webpack setup). After switching to wordpress 5.5 Gutenberg branch version of image block, everything was fine.

Blocks. How to store default settings?

As Tom mentioned, you can use Templates, which allows you to define a preset of blocks that are available by default in your post whenever you try to create a new post: https://developer.wordpress.org/block-editor/developers/block-api/block-templates/ If you aren’t ready to get your hands dirty with code, you can also use Justin Tadlock’s Block Pattern Builder plugin to … Read more