-
Notifications
You must be signed in to change notification settings - Fork 13
Description
I'm trying to use the @prezly/slate-lists package as per the usage guide (https://www.npmjs.com/package/@prezly/slate-lists). When I define my editor with
const [editor] = useState(() => withLists(schema)(withHistory(withReact(createEditor()))));
i'm getting Argument of type 'CustomEditor' is not assignable to parameter of type 'SlateEditor'. If I drilldown into the error, I see Type 'Node' is not assignable to type 'TDescendant'. Type 'BaseElement & AlignableElement & { type: CustomElementType.OrderedList; }' is not assignable to type 'TDescendant'. Type 'BaseElement & AlignableElement & { type: CustomElementType.OrderedList; }' is not assignable to type 'TText'. Property 'text' is missing in type 'BaseElement & AlignableElement & { type: CustomElementType.OrderedList; }' but required in type '{ text: string; }'
My custom editor type for slate is defined like CustomEditor: BaseEditor & ReactEditor & HistoryEditor.
How can I make it all work?
Packages used:
- "slate": "0.112.0",
- "slate-history": "0.110.3",
- "slate-react": "0.112.1",
- "@prezly/slate-lists": "0.118.0"