draft-convert icon indicating copy to clipboard operation
draft-convert copied to clipboard

Decorators

Open timothyarmes opened this issue 6 years ago • 1 comments

Is there a way to convert draftjs decorators to HTML? For example, this tweet decorator example from draftjs : https://github.com/facebook/draft-js/blob/master/examples/draft-0-10-0/tweet/tweet.html

Currently when I try to convert my content to HTML, I see my strategy is called, but my component is never rendered in the output.

timothyarmes avatar Sep 30 '19 14:09 timothyarmes

There is not - decorators that aren't paired with an entity like in that example are usually meant for transient, editor-only UI and are independent of ContentState altogether. I'd recommend finding a way to persist the ranges you're hoping to add a component around using an entity range that will be represented in the ContentState.

benbriggs avatar Sep 30 '19 19:09 benbriggs