From d1a478be31ef236dac993aea5151f15f09f73de1 Mon Sep 17 00:00:00 2001 From: Ramratan Gupta Date: Fri, 12 Aug 2016 16:44:16 +0530 Subject: [PATCH] tinymce.4.2.7.min.js Uncaught TypeError: Cannot read property 'body' of null I am using react-tinymce 0.2.3 and tinymce 4.2.7. as per below code in handleEditorChange, after call of e.target.getContent() I am getting error tinymce.4.2.7.min.js:10 Uncaught TypeError: Cannot read property 'body' of null I tried to put e.target.getContent() in jQuery's ready function but no success. I am using react 0.13.3. http://stackoverflow.com/questions/38613095/tinymce-4-2-7-min-js-uncaught-typeerror-cannot-read-property-body-of-null --- lib/components/TinyMCE.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/components/TinyMCE.js b/lib/components/TinyMCE.js index eb778e9..3d1b7d4 100644 --- a/lib/components/TinyMCE.js +++ b/lib/components/TinyMCE.js @@ -52,7 +52,8 @@ const TinyMCE = React.createClass({ componentDidMount() { const config = clone(this.props.config); - this._init(config); + const content = clone(this.props.content); + this._init(config,content); }, componentWillReceiveProps(nextProps) { @@ -114,7 +115,7 @@ const TinyMCE = React.createClass({ }); // need to set content here because the textarea will still have the // old `this.props.content` - if (content) { + if (typeof content !=="undefined") { editor.on('init', () => { editor.setContent(content); });