I have used Editor-JS in ReactJS and simple JS too. In react I have used react-editor-js package in ReactJS and trying to use the same in React-Native but it is giving a reference error:
Error: Requiring module "node_modules\react-editor-js\dist\react-editor-js.umd.js", which threw an exception: ReferenceError: Can't find variable: Element
I am new to Native and not able to resolve this error.
Code:
import EditorJs from 'react-editor-js';
Initializing Editor
<EditorJs tools={EDITOR_JS_TOOLS} />
Editor Tools
import Paragraph from '@editorjs/paragraph''
export const EDITOR_JS_TOOLS = {
paragraph: Paragraph,
}
I have tried to use the official EditorJS package too but it needs
<div id="editorjs"></div>
and id is not supported in React-Native. I can't use any other editor because whole of my app should be consistent with the Web app where EditorJS is being used.