1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-02 19:52:32 +02:00
Files
slate/docs/libraries/slate-history/with-history.md

513 B

withHistory

The withHistory plugin adds the HistoryEditor to an Editor instance and keeps track of the operation history of a Slate editor as operations are applied to it, using undo and redo stacks.

withHistory<T extends Editor>(editor: T): T & HistoryEditor

Add HistoryEditor interface to an instance of any Editor.

When used with withReact, withHistory should be applied inside. For example:

const [editor] = useState(() => withReact(withHistory(createEditor())))