Gutenberg Tips — Generate your block’s class name using useBlockProps()

useBlockProps has been introduced since WordPress 5.6, which fixes a previous weird issue where the className property is only passed in the edit function but not the save function in registerBlockType. With useBlockProps, we can use the same ‘wp-block-’ prefixed class name in both the edit and save functions!