1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 10:51:44 +02:00

Import Transforms in custom elements walkthough (#3630)

This commit is contained in:
George Rodier
2020-04-22 12:09:42 -04:00
committed by GitHub
parent f6bfe034d7
commit 9a6e8fba92

View File

@@ -117,8 +117,8 @@ const DefaultElement = props => {
Okay, but now we'll need a way for the user to actually turn a block into a code block. So let's change our `onKeyDown` function to add a `` Ctrl-` `` shortcut that does just that:
```jsx
// Import the `Editor` helpers from Slate.
import { Editor } from 'slate'
// Import the `Editor` and `Transforms` helpers from Slate.
import { Editor, Transforms } from 'slate'
const App = () => {
const editor = useMemo(() => withReact(createEditor()), [])