Tinymce not input TypeError: The theme is not a constructor (...)

advertisements

My following react component show following error with tinymce and did not mount in dom.

theme.js:1 Uncaught SyntaxError: Unexpected token <

tinymce.js:38447 Uncaught TypeError: Theme is not a constructor(…)

import React from "react";
import tinymce from "tinymce";

const ParagraphDetails = React.createClass({
    componentWillMount(){
        tinymce.init({
            selector: ".tinymce-editor",
            themes: "modern",
        })
    },
    render(){
        return <div>
            <label>About
                <textarea rows="3" className="tinymce-editor"></textarea>
            </label>
        </div>
    }
});

What is going wrong?


You should initialize tinymce in componentDidMount , and not in componentWillMount. Also, you need to export 'ParagraphDetails' class.