Remove useless usecallback

This commit is contained in:
DefectingCat
2022-08-25 17:08:18 +08:00
parent 6a12e8508e
commit 086da74721
5 changed files with 23 additions and 27 deletions

View File

@ -1,9 +1,9 @@
import { getHeadings, SingleToc } from 'lib/utils';
import Anchor from 'components/mdx/Anchor';
import styles from './PostToc.module.css';
import classNames from 'classnames';
import { Fragment, useCallback, useState } from 'react';
import Anchor from 'components/mdx/Anchor';
import { SingleToc } from 'lib/utils';
import { Fragment, useState } from 'react';
import { FiChevronDown } from 'react-icons/fi';
import styles from './PostToc.module.css';
interface Props {
toc: SingleToc[];
@ -22,7 +22,7 @@ const TocItem = ({ item }: { item: SingleToc }) => {
const PostToc = ({ toc, tocLength }: Props) => {
const [show, setShow] = useState(false);
const handleClick = useCallback(() => setShow((show) => !show), []);
const handleClick = () => setShow((show) => !show);
return (
<>