refactor: Use useRenderHtmlPlugin

This commit is contained in:
robin 2023-09-20 18:19:50 +08:00
parent 37eea9d9b3
commit 1100ec6145
2 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import {
import { scrollToElementTop, bgFadeOut } from '@/utils';
import { AnswerItem } from '@/common/interface';
import { acceptanceAnswer } from '@/services';
import { useRenderHtmlPlugin } from '@/utils/pluginKit';
interface Props {
data: AnswerItem;
@ -39,6 +40,8 @@ const Index: FC<Props> = ({
});
const [searchParams] = useSearchParams();
const answerRef = useRef<HTMLDivElement>(null);
useRenderHtmlPlugin(answerRef.current);
const acceptAnswer = () => {
acceptanceAnswer({
question_id: data.question_id,

View File

@ -16,6 +16,7 @@ import {
modifyAnswer,
useQueryRevisions,
} from '@/services';
import { useRenderHtmlPlugin } from '@/utils/pluginKit';
import './index.scss';
@ -73,6 +74,7 @@ const Index = () => {
});
const questionContentRef = useRef<HTMLDivElement>(null);
useRenderHtmlPlugin(questionContentRef.current);
useEffect(() => {
if (!questionContentRef?.current) {