plane/apps/app/pages/editor.tsx

27 lines
609 B
TypeScript
Raw Normal View History

import React from "react";
import dynamic from "next/dynamic";
2022-11-19 14:21:26 +00:00
const RichTextEditor = dynamic(() => import("../components/lexical/editor"), {
ssr: false,
});
2022-11-19 14:21:26 +00:00
const LexicalViewer = dynamic(() => import("../components/lexical/viewer"), {
ssr: false,
});
2022-11-19 14:21:26 +00:00
const Home = () => {
const [value, setValue] = React.useState("");
const onChange: any = (value: any) => {
console.log(value);
setValue(value);
};
2022-11-19 14:21:26 +00:00
return (
<>
<RichTextEditor onChange={onChange} value={value} id="editor" />
<LexicalViewer id="institution_viewer" value={value} />
</>
2022-11-19 14:21:26 +00:00
);
};
export default Home;