Issue #4937Opened February 20, 2023by besart-k1 reactions

BUG: block:custom is not working on React

Question

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Chrome Version 110.0.5481.100 (Official Build) (arm64)

Reproducible demo link

None

Describe the bug

I am trying to replicate in React the customizing the Block Manager like in this example Vue block manager, but the "block:custom" callback is not called.

How to reproduce the bug? Put this on init configuration blockManager: { blocks: blocks, custom: true },

Put this on inside useEffect useEffect(()=>{ editor.on('block:custom', (props)=>{console.log(props)}) },[])

What is the expected behavior? props needs to shown on console log like in Vue example

What is the current behavior? callback of block:custom is not called

If is necessary to execute some code in order to reproduce the bug, paste it here below:

// your code here

Code of Conduct

  • I agree to follow this project's Code of Conduct

Answers (1)

artfFebruary 23, 20231 reactions

@besart-k you have to provide a reproducible demo as if it works with the current Vue demo example it shouldn't be different in React. Maybe you're using an old version of grapesjs or doing something wrong in your React app, so in this case the reproducible demo is mandatory. I'm closing this one as the demo itself uses the latest version it seems to work properly for custom blocks.

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.