Remove useless dependencies

This commit is contained in:
DefectingCat
2022-08-18 17:24:27 +08:00
parent 1849f84239
commit 741a19fd90
4 changed files with 3 additions and 52 deletions

View File

@ -1,22 +1,8 @@
import useMounted from 'lib/hooks/useMounted';
import { useEffect } from 'react';
import tocbot from 'tocbot';
const SlideToc = () => {
const { mounted } = useMounted();
useEffect(() => {
// Waiting the right time.
mounted &&
tocbot.init({
tocSelector: '.toc',
contentSelector: '#post-content',
headingSelector: 'h1, h2, h3',
});
return () => tocbot.destroy();
}, [mounted]);
return (
<>
<div className="flex justify-end">