Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Element Type Invalid Error rendering Custom block type #1497

@albertlockett

Description

@albertlockett

Hi, I'm wondering if this is a bug or if it's something I'm doing wrong. I'm following the instructions on the draft-js site for custom block rendering:

https://draftjs.org/docs/advanced-topics-custom-block-render-map.html#content

When I try to swap the block type to the custom block type I configure, it gives the error:

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in.

Here's a github I made to show the problem:
https://github.com/albertlockett/draftjs-help/

If you click just below the button, (in the editor), and the click the button to change the block type, you'll get that error in the console.

I would expect that it renders the editor to change ot my custom block type.

I experienced this in Chrome
"draft-js": "0.10.0",
"react": "15.4.2",

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