DEV Community

Discussion on: How To Integrate A Rich Text Editor (WYSIWYG) In Your React.Js Project.

Collapse
 
asitsi profile image
asitsi

how to send data using tinymce,WYSIWYG through API ...?

Collapse
 
emmaccen profile image
Lucius Emmanuel Emmaccen

Hi, "Asitsi".
One way to do this is :
If you go over the code snippets I provided in the article, you'd notice a handleEditorChange function.

  handleEditorChange = (e) => {
    console.log(
      'Content was updated:',
      e.target.getContent()
    );
  }
Enter fullscreen mode Exit fullscreen mode

So with this function, you can grab the values using the e.target.getContent() and store the value in SetState after which you can then access the stored values and send to your API.

Let me know if this helps, thanks.