ahmadawais / create-guten-block

📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.
https://Awais.dev/cgb-post
MIT License
3.15k stars 327 forks source link

Adding Extra Div in save = No error + not saving? #266

Open altafhpatel opened 4 years ago

altafhpatel commented 4 years ago

edit: ({attributes,setAttributes}) => { function onChangeHeading(heading){ setAttributes({heading : heading}); } function onChangeText(text){ setAttributes({text : text}); } function onSelectImage(image){ setAttributes({imageUrl:image.url}) } return (

{ setAttributes({ imageAlt: media.alt, imageUrl: imageUrl.src }); } } onSelect={ onSelectImage} type="image" value={ attributes.imageUrl } render={ ({ open }) => } />
        );
},

save: ({attributes}) => {
    return (
        <div className="icon-box">
        <div className="col-sm-3">
            <img src={attributes.imageUrl} />
            <RichText.Content tagName="h2" value={attributes.heading}/>
            <RichText.Content tagName="p" value={attributes.text} />
            </div>
        </div>);
},

when i remove that col-sm-3 div it save why ?