admin管理员组

文章数量:1122832

When we add additional classes to our custom block they are not being added in the editor. When we save the block and view the front-end the additional classes are showing. But in the editor they won't show up.

Here is the code of our block:

import { useBlockProps } from '@wordpress/block-editor';


export default {
    name: 'erik-dekker/button',
    title: 'Knop',
    icon: 'button',
    category: 'erik-dekker',
    edit: () => {
        const blockProps = useBlockProps();

        return (
            <div { ...blockProps }>hello world!</div>
        );
    },
    save: () => {
        const blockProps = useBlockProps.save();

        return (
            <div { ...blockProps }>hello world!</div>
        );
    }
}

Thanks for your time!

本文标签: javascriptAdditional CSS classes not being added in Gutenberg editor