From 74c86c1960946df01b817d30a519d00d680092fc Mon Sep 17 00:00:00 2001 From: DefectingCat Date: Wed, 5 Jan 2022 17:46:36 +0800 Subject: [PATCH] Fix comment content jitter --- pages/p/[slug].tsx | 19 +- public/md/Build your own React-渲染DOM.md | 321 ++++++++++++++++++++++ 2 files changed, 332 insertions(+), 8 deletions(-) create mode 100644 public/md/Build your own React-渲染DOM.md diff --git a/pages/p/[slug].tsx b/pages/p/[slug].tsx index fb5cb78..728c676 100644 --- a/pages/p/[slug].tsx +++ b/pages/p/[slug].tsx @@ -49,14 +49,15 @@ export function getStaticPaths() { }; } -export const getStaticProps: GetStaticProps<{ postData: AllPostsWithContent }> = - ({ params }) => { - return { - props: { - postData: getPostData(params?.slug?.toString() ?? ''), - }, - }; +export const getStaticProps: GetStaticProps<{ + postData: AllPostsWithContent; +}> = ({ params }) => { + return { + props: { + postData: getPostData(params?.slug?.toString() ?? ''), + }, }; +}; const processedContent = unified() .use(remarkParse) @@ -185,7 +186,9 @@ const Post = ({ postData }: InferGetStaticPropsType) => { {/* Comment */} - {commentInView && } + + {commentInView && } +