drawdb/src/components/rich_editor.jsx
2023-09-19 15:51:49 +03:00

20 lines
464 B
JavaScript

import React, { useState } from "react";
import { createEditor } from "slate";
import { Slate, Editable, withReact } from "slate-react";
const initialValue = [
{
type: "paragraph",
children: [{ text: "A line of text in a paragraph." }],
},
];
export default function RichEditor() {
const [editor] = useState(() => withReact(createEditor()));
return (
<Slate editor={editor} initialValue={initialValue}>
<Editable />
</Slate>
);
}