diff --git a/src/components/memo/MemoViewer.tsx b/src/components/memo/MemoViewer.tsx index a3beb53..cb8ea1c 100644 --- a/src/components/memo/MemoViewer.tsx +++ b/src/components/memo/MemoViewer.tsx @@ -1,15 +1,14 @@ 'use client'; -import { EditorContent, useEditor } from '@tiptap/react'; +import { generateHTML } from '@tiptap/react'; import MemoViewerHeader from './MemoViewerHeader'; import { handleTiptapExtensions } from '@/components/editor/extensions'; import TagView from '../shared/TagView'; -import { handleTiptapEditorProps } from '../editor/props'; -import { useEffect } from 'react'; +import { useMemo } from 'react'; type Props = { title: string; - content: string; + content: object; color: string; memoTags: string[]; memoId: number; @@ -38,15 +37,8 @@ export default function MemoViewer({ seriesTitle, isLogin, }: Props) { - const editor = useEditor({ - extensions: handleTiptapExtensions('memo', memoId), - editorProps: handleTiptapEditorProps('memo', memoId), - editable: false, - content: content, - }); - - useEffect(() => { - editor?.commands.setContent(content); + const output = useMemo(() => { + return generateHTML(content, handleTiptapExtensions('memo', memoId)); }, [content]); return ( @@ -83,9 +75,10 @@ export default function MemoViewer({ {title}
-