GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

React with GrapeJS- without plugin #1899

Closed prgmono2018 closed 5 years ago

prgmono2018 commented 5 years ago

Hi, How can I use grapesjs with react? I don't want to use the plugin- I have made some changes and I want to use the editor with react and other pages. how can I do it?

Thanks you vaety much!

simplecommerce commented 5 years ago

Not sure what you mean by without plugin.

But if you are talking about just the GrapesJS instance, you just need to initialize it in componentDidMount.

So for example:

In your render

render() {
  return <div id="gjs"></div>
}

In componentDidMount

const editor = grapesjs.init({
  // Indicate where to init the editor. You can also pass an HTMLElement
  container: '#gjs',
});

Something like that, normally it should work.

artf commented 5 years ago

Nothing to add beyond what already said by @simplecommerce

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.