import { storiesOf } from "@storybook/react"; import { IRteRef, makeRteApi, Rte } from "@vivid-planet/comet-admin-rte"; import * as React from "react"; import { exampleContent, PrintEditorState, RteLayout, useAutoFocus } from "./helper"; const [useRteApi] = makeRteApi(); function Story() { const { editorState, setEditorState } = useRteApi({ defaultValue: JSON.stringify(exampleContent) }); // defaultValue is optional // focus the editor to see the cursor immediately const editorRef = React.useRef(); useAutoFocus(editorRef); return ( <> ); } storiesOf("comet-admin-rte", module).add("Rte, minimal configuration", () => );