Я
подскажи пожалуйста, в чем может быть дело?
сделал все в точности как в ридми:
import { Editor, EditorState } from "draft-js";
function MyEditor() {
const [editorState, setEditorState] = React.useState(
EditorState.createEmpty()
);
const editor = React.useRef(null);
function focusEditor() {
editor.current.focus();
}
React.useEffect(() => {
focusEditor();
}, []);
return (
<div onClick={focusEditor}>
<Editor
ref={editor}
editorState={editorState}
onChange={editorState => setEditorState(editorState)}
/>
</div>
);
}
render(<MyEditor />, DOM_NODE);
ловлю в косонли браузера такую ошибку:
Uncaught TypeError: blockRendererFn is not a function
at DraftEditorContents.render (DraftEditorContents-core.react.js:133)