DraftEntityType needs to be loosened
See original GitHub issueFrom 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
andIMAGE
? I didn’t find any explanations on that.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for raising this! Loosening the Flow type here seems reasonable to me, so going to merge @juliankrispel’s PR 😃
Same issue here, I have to add
// $FlowFixMe
to be able to use what I want for entity type. I guessDraftEntityType
should be changed tostring
.