ctrl z not working in my slateJs editor, but it is working fine in slate example
<Slate editor={editor} value={initialValue}>
<Editable
renderElement={renderElement}
renderLeaf={renderLeaf}
...
...
onKeyDown = {()=> {
console.log('key pressed')
}
</Editable>
</Slate>
You have to use withHistory like the source of the example you have given: https://github.com/ianstormtaylor/slate/blob/main/site/examples/richtext.tsx#L28 for default undo and redo behaviour