Extensions
History
Undo and redo editor changes.
The History extension adds Undo and Redo buttons to the toolbar. The buttons are automatically disabled when there is nothing to undo or redo.
Import
import { History } from 'ritext/extension/history';Usage
const extensions = [History];Features
- Undo button (disabled when no history)
- Redo button (disabled when no redo stack)
- Uses
useEditorStateto reactively update button state
Options
Prop
Type
Keyboard Shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Undo | Ctrl+Z | ⌘+Z |
| Redo | Ctrl+Y or Ctrl+Shift+Z | ⌘+Shift+Z |
