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)
@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.
Issue #4947
BUG: Undo manager not working properly on undoing a remove action
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome - version 110.0.5481.100 (Official Bu...
Issue #5795
BUG: How to add a addtional custom block manager like tab or section like block manager and style manager ,and add some blocks it to it?
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? chrome v9 Reproducible demo link Describe...
Issue #6040
BUG: Cannot read properties of undefined (reading 'lastComponent')
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Version 127.0.6533.89 (Official Build) (64...
Issue #4127
BUG:
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 97.0.4692.99 (Official Buil...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.