mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-16 01:01:38 +00:00
Remove useless dependencies
This commit is contained in:
@ -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">
|
||||
|
Reference in New Issue
Block a user