diff --git a/src/pages/Layout/index.tsx b/src/pages/Layout/index.tsx index d0f1071..b8d59ec 100644 --- a/src/pages/Layout/index.tsx +++ b/src/pages/Layout/index.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useEffect, useState } from "react"; import { graphql, Script } from "gatsby"; import config from '../../../data/site-config'; import Base from "../../components/Base"; @@ -20,7 +20,13 @@ const Comment = () => { } const Layout = ({ data, children }) => { + const [loadComment, setLoadComment] = useState(false); + const post = data.mdx.frontmatter; + + useEffect(() => { + setLoadComment(true) + }, []) return (
@@ -41,7 +47,9 @@ const Layout = ({ data, children }) => {
- + { loadComment && + + } ) }