Issue #2919💬 AnsweredOpened July 26, 2020by BerkeAras1 reactions

Custom Blocks are wrapped into a div

快速解答by mcottret1

Hi @BerkeAras ! As shown on the Getting Started page, you can specify a tagName property when defining custom Blocks & Components to override the default div tag. Cheers !

Read full answer below ↓

Question

Version: 0.16.18

Are you able to reproduce the bug from the demo?

[X] Yes: https://codesandbox.io/s/empty-night-8q733?file=/index.js [ ] No

What is the expected behavior? The Element "Link Button" should not be in a div. There should not be a div, just a 'a' tag

What is the current behavior?

Custom blocks are wrapped into a div.

Are you able to attach screenshots, screencasts or a live demo?

[X] Yes https://codesandbox.io/s/empty-night-8q733?file=/index.js [ ] No

Answers (2)

mcottretJuly 27, 2020

Hi @BerkeAras !

As shown on the Getting Started page, you can specify a tagName property when defining custom Blocks & Components to override the default div tag.

Cheers !

artfJuly 29, 2020

You're passing a description for a component (<div> as default) and then adding inner content (<a> tag) to that component

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.