draftjs how to initiate an editor with content
问题 Stumbled on this cool text editor, draft.js by facebook. I try to follow the example in github but I want to create an editor with content instead an empty editor. var EditorState = Draft.EditorState; var RichEditor = React.createClass({ getInitialState(){ return {editorState: EditorState.createWithContent("Hello")} //the example use this code to createEmpty editor // return ({editorState: EditorState.createEmpty()}) } }); run it, but I get error saying that "Uncaught TypeError: contentState