Skip to content

Instantly share code, notes, and snippets.

@ksimons
Created September 22, 2020 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksimons/2e5af54d96aa44c1f274a476e3249d73 to your computer and use it in GitHub Desktop.
Save ksimons/2e5af54d96aa44c1f274a476e3249d73 to your computer and use it in GitHub Desktop.
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