uchihamalolan / draftjs-mentions

A POC for Implementing mentions with DraftJS & DraftJS Plugins. (Including storing and fetching from server with the same state)

Home Page:https://drafter-mentions.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

draftjs-mentions

A POC for Implementing mentions with DraftJS & DraftJS Plugins. (Including storing and fetching from server with the same state)

Uses the Following

Approach

Write

  • Convert ContentState to RawData
  • Strip unnecessary properties from RawData (function inside serializer folder)
  • Save the JSON as string in backend

Read

  • Use Editor with readOnly={true} for displaying notes/comments/posts with "mentions"
  • Fetch JSON String from Server (DB)
  • Parse and build back the RawData (to feed to ContentState via convertFromRaw)
  • Create ContentState and initialize EditorState with it

This Project is built using Vite

About

A POC for Implementing mentions with DraftJS & DraftJS Plugins. (Including storing and fetching from server with the same state)

https://drafter-mentions.netlify.app/


Languages

Language:TypeScript 94.4%Language:HTML 2.9%Language:CSS 2.7%