Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubts regarding React integration #49

Closed
iamjamielobo opened this issue Aug 27, 2018 · 2 comments
Closed

Doubts regarding React integration #49

iamjamielobo opened this issue Aug 27, 2018 · 2 comments

Comments

@iamjamielobo
Copy link

Hi Guys

I've been trying to integrate Grapes in my current React Project.
I'm finding it a bit tedious to get an onChange event to get any of the changes made within the editor.
I'm using the newsletter preset.

My current config looks something like this

editor = grapesjs.init({ height: '100%', assetManager: { assets: images, upload: 0, uploadText: 'Uploading is not available in this demo' }, container: '#gjs', fromElement: true, plugins: ['gjs-preset-newsletter'] })

Thanks.

@luishdez
Copy link

luishdez commented Dec 10, 2018

I used

editor.on('component:update', onUpdate); and then

  handleOnUpdate = () => {
    this.setState({
      html: this.editor.runCommand('gjs-get-inlined-html'),
    });
  };

@dosponsor
Copy link

Thanks this is working.

@artf artf closed this as completed Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants