A utility library for migrating content from Draft.js to Lexical editor format. Current version 0.0.5 is pre-release beta, with no established release cadence. It converts Draft.js contentState to Lexical serialized format, covering common block and inline styles. Key differentiators: handles Draft.js entities (links, mentions) and nested lists. Suitable for migrating legacy Draft.js editors to Lexical. Due to early stage, expect API changes and limited documentation.
npm install draftjs-to-lexicalNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a Draft.js contentState object to a Lexical editor state (array of nodes).
Pin exact version in package.json.
Check source for supported types; fallback to manual conversion.
Pre-process contentState to map custom entities.
Examine node_modules/draftjs-to-lexical/dist for types and implementation.
Apply custom styles post-conversion.
Run `npm install draftjs-to-lexical` and ensure `node_modules` is included in tsconfig.
Use `import { draftjsToLexical } from 'draftjs-to-lexical'`.Pass a valid Draft.js contentState object: `{ blocks: [...], entityMap: {} }`.Check that contentState is defined before calling draftjsToLexical.
No dependency data recorded yet.