Can't use grapesjs-mjml inside a react app.
See original GitHub issueHello and thanks for grapesjs!
I’m running into an issue using the MJML plugin with grapesjs inside a react app.
The canvas loads but I’m not able to drop any blocks into the canvas area. Not using the the mjml plugin the canvas loads and allows for blocks to be dropped into the canvas area.
I get the following warning when using grapesjs-mjml plugin:
Invalid target position: Target collection not found, Target is not droppable, accepts [undefined], Component not draggable, acceptable by [undefined]
Here is my setup, maybe I’m missing something simple.
"grapesjs": "^0.16.30",
"grapesjs-mjml": "^0.3.4",
import 'grapesjs/dist/css/grapes.min.css';
import grapesjs from 'grapesjs';
import grapesjsMJML from 'grapesjs-mjml';
import React, { useEffect } from 'react';
export const Editor = () => {
useEffect(() => {
const editor = grapesjs.init({
container: '#email-editor',
fromElement: true,
avoidInlineStyle: false,
panels: { defaults: [] },
plugins: [grapesjsMJML],
pluginsOpts: {
[grapesjsMJML]: {}
},
height: '300px',
blockManager: {
appendTo: '#email-editor-blocks',
}
});
}, []);
return (
<div>
<div id="email-editor" />
<div id="email-editor-blocks" />
</div>
);
};
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:10
Top Results From Across the Web
grapesjs-mjml - npm
Start using grapesjs-mjml in your project by running `npm i grapesjs-mjml`. There are 5 other projects in the npm registry using grapesjs-mjml.
Read more >1 - Asset Manager in Grapes JS - Webpage Editor - YouTube
So for now, we saw how to use Grapes JS with Vaniall JS /HTML and also with React. In this, I will try...
Read more >4 - Create Custom Swiper Plugin for Grapes JS - No Code
In this video, we will create a Grapes JS plugin for Swiper and use it. ... grapesjs tutorial grapesjs - mjml grapesjs template...
Read more >Grapes.js MJML Editor - Save additional data with ... - CodePen
Grapes.js MJML Email Editor exports mjml to html. To save that html, along with the mjml, css and their json representations, just use...
Read more >grapesjs-mjml examples - CodeSandbox
Learn how to use grapesjs-mjml by viewing and forking example apps that make use ... Please use it and report everything inside the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try adding
It can be done thru editor.addComponents or fromElement
Hmm interesting, I’ve had problems in the past using VueJS (https://github.com/artf/grapesjs-mjml/issues/155) but I haven’t seen this error before.
Does the block manager get rendered correctly? also could you try the unminified build aswell and see if that work: