我正在获取要将对象分配给draftjs编辑器的json对象 但是当我尝试分配它时会抛出错误
“ PageContainer.js:165未捕获的TypeError:draft_js__WEBPACK_IMPORTED_MODULE_1 __。EditorState.createFromText不是函数”
this.setState({
editorState2: EditorState.createFromText(ContentState.createFromText("hi"))
});
编辑器已使用
从构造函数创建 constructor(props) {
super(props);
this.state = {
editorState1: EditorState.createEmpty(),editorState2: EditorState.createEmpty(),persons: []
};
}