Skip to content

"React does not recognize the blockKey prop on a DOM element" error when using plugins #1342

@angithub13

Description

@angithub13

Hello. When I create a plugin (I tried Linkify and Hashtag) and connect it to the Editor, everything seems fine, but the moment I insert for example a link into the editor, I get an error:

React does not recognize the blockKey prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase blockkey instead. If you accidentally passed it from a parent component, remove it from the DOM element.

The link in the editor is styled though - like a proper anchor tag: its color is blue, and it's hoverable.

### My code:
...
import Editor from "draft-js-plugins-editor";
import createLinkifyPlugin from "draft-js-linkify-plugin";
import "draft-js-linkify-plugin/lib/plugin.css";
...
const linkifyPlugin = createLinkifyPlugin();
const plugins = [linkifyPlugin];
...
<div className="editor-wrapper" onClick={focusEditor}> <Editor ref={editor} editorState={editorState} onChange={newEditorState => setEditorState(newEditorState)} handleKeyCommand={handleKeyCommand} plugins={plugins} /> </div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions