Skip to content

Commit

Permalink
chore(root): fix warning useLayoutEffect ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
hendraaagil committed Jun 8, 2021
1 parent 2556df2 commit 6377d15
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions components/blog/Comments.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import { useEffect, useState } from 'react';
import { ReactCusdis } from 'react-cusdis';

const Disqus = ({ pageUrl, pageId, pageTitle }) => {
const Comments = ({ pageUrl, pageId, pageTitle }) => {
const appId = process.env.NEXT_PUBLIC_CUSDIS_APPID;
const [show, setShow] = useState(false);

useEffect(() => {
setShow(true);
}, []);

if (!show) {
return null;
}

return (
<ReactCusdis
Expand All @@ -16,4 +26,4 @@ const Disqus = ({ pageUrl, pageId, pageTitle }) => {
);
};

export default Disqus;
export default Comments;

1 comment on commit 6377d15

@vercel
Copy link

@vercel vercel bot commented on 6377d15 Jun 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.