A POC for Implementing mentions with DraftJS & DraftJS Plugins. (Including storing and fetching from server with the same state)
- DraftJs for Rich Text Handling
- DraftJS Plugin Mentions for mentions decorators
- Ant design for implementing Pop-overs
- StyledComponents for general styling
Write
- Convert
ContentState
toRawData
- Strip unnecessary properties from
RawData
(function inside serializer folder) - Save the JSON as string in backend
Read
- Use
Editor
withreadOnly={true}
for displaying notes/comments/posts with "mentions" - Fetch JSON String from Server (DB)
- Parse and build back the
RawData
(to feed to ContentState viaconvertFromRaw
) - Create ContentState and initialize EditorState with it