Skip to content

Commit

Permalink
fix: 게시글 수정 후 즉시 반영안되는 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
bae-sh committed Jan 1, 2024
1 parent cde78a7 commit f91113b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/src/components/board/PostDetail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//core
import React from 'react';
import React, { useEffect } from 'react';
import Link from 'next/link';

//interface
Expand Down Expand Up @@ -45,6 +45,12 @@ export default function PostDetail({ data, IS_AUTHOR }: PostDetail) {
content: data.postContent,
});

useEffect(() => {
if (editor) {
editor.commands.setContent(data.postContent);
}
}, [data]);

return (
<article className="flex flex-col max-w-4xl min-w-full gap-8 px-4 py-6 m-auto bg-white border-2 border-gray-100 sm:p-12">
<h1 className="text-4xl font-extrabold ">{data.postTitle}</h1>
Expand Down

0 comments on commit f91113b

Please sign in to comment.