Category : draft-js-plugins

I am trying this: import React from ‘react’; import Editor from ‘draft-js-plugins-editor’; import createToolbarPlugin from ‘draft-js-static-toolbar-plugin’; import { EditorState } from ‘draft-js’; import ‘draft-js-static-toolbar-plugin/lib/plugin.css’; export default function MyEditor() { const [editorState, setEditorState] = React.useState(() => EditorState.createEmpty()); const toolbarPlugin = createToolbarPlugin(); const { Toolbar } = toolbarPlugin; const plugins = [toolbarPlugin]; this.editor = React.useRef(null); return ( ..

Read more

I am implementing React’s "draft js" with mention plugin. https://www.draft-js-plugins.com/ So far i am able to create the editor and creating the mention tags. I can save the mentions in my database using rest API. Here is what i do on saving content to db: const contentState = this.state.MyInput.getCurrentContent(); const raw = convertToRaw(contentState); const data ..

Read more