Created
September 22, 2020 12:08
-
-
Save ksimons/2e5af54d96aa44c1f274a476e3249d73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MyEditor() { | |
const editor = useMemo(() => withReact(createEditor()), []); | |
const [value, setValue] = React.useState<Node[]>([ | |
{ | |
children: [{ text: 'Testing' }], | |
}, | |
]); | |
return ( | |
<Slate editor={editor} value={value} onChange={(v) => setValue(v)}> | |
<Editable /> | |
</Slate> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment