Guest User

Untitled

a guest
Oct 15th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. Im trying to render data from the tinyms editor it was showing undefined in console using react js. I want to write some content in the tinyms editor using react js ...please help me with this problem..
  2.  
  3. import React, { Component } from 'react';
  4. import { Editor } from '@tinymce/tinymce-react';
  5.  
  6. class AddEvent extends Component {
  7.  
  8. constructor() {
  9. super();
  10. this.state = {
  11. content: '',
  12.  
  13. };
  14. this.handleChange=this.handleChange.bind(this);
  15. this.handleEditorChange=this.handleEditorChange.bind(this.content);
  16.  
  17. }
  18. render() {
  19. return (
  20. <form>
  21. <Editor
  22. initialValue="<p>This is the initial content of the editor</p>"
  23. init={{ plugins: 'link image code',
  24. toolbar: 'undo redo | bold italic| alignleft aligncenter alignright | code'
  25. }}
  26. onChange={this.handleEditorChange}
  27. />
  28.  
  29. <div className="col-md-3">
  30. <button className="btn btn-block btn-primary btn-lg" type="submit">Save Event</button>
  31. </div>
  32. </form>
Add Comment
Please, Sign In to add comment