WordPress gutenberg block serverside rendering html elements not showing up

Question

import { registerBlockType } from 'wordpress user/blocks';
import ServerSideRender  from 'wordpress user/server-side-render'
import {useBlockProps}  from 'wordpress user/block-editor'

registerBlockType('fsm/custom-logo-block',{
    title:"Fsm Logo",
    description:"Adres Eklemek İçin Kullanabilirsiniz.",
    icon:"format-gallery",
    category:"widgets",
    attributes:{
        width:"string",
        heigth:"string"
    },
    edit:function({attributes,setAttributes}){
        return (
            <div {...useBlockProps()}>
                <h1>Web Site Logo</h1> // this does not appear
                <input placeholder="width" onChange={(e)={setAttributes({width:e.target.value})}}/>
                <input placeholder="height" onChange={(e)=>{setAttributes({heigth:e.target.value})}}/>
                <ServerSideRender block="custom-logo-block"/>
            </div>
        )
    },
    save:function({attributes}){
        return null
    }

})

0
Mustafa Dalkılıç 1 month 2023-02-10T15:08:23-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse