question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DraftEntityType needs to be loosened

See original GitHub issue

From the doc that introduces Entities, it said

type: A string that indicates what kind of entity it is, e.g. ‘LINK’, ‘MENTION’, ‘PHOTO’

But in the source code, the type of an Entity is limited to LINK, TOKEN , PHOTO or IMAGE, as seen in src/stubs/ComposedEntityType.js.

So my questions:

  • Is the entity type supposed to be customizable?
  • I’m considering using Flow in my projects, will a custom entity type, say VIDEO, break Flow’s type checking?
  • What’s the difference between PHOTO and IMAGE? I didn’t find any explanations on that.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
niveditccommented, Oct 4, 2018

Thanks for raising this! Loosening the Flow type here seems reasonable to me, so going to merge @juliankrispel’s PR 😃

1reaction
cedricmessiantcommented, Sep 11, 2018

Same issue here, I have to add // $FlowFixMe to be able to use what I want for entity type. I guess DraftEntityType should be changed to string.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entity - Draft.js
Entity objects returned by Entity methods are represented as DraftEntityInstance immutable records. These have a small set of getter functions ...
Read more >
Top 5 draft-js Code Examples - Snyk
Learn more about how to use draft-js, based on draft-js code examples created from the most popular ways it is used in public...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found