diff --git a/src/client/theme-default/slots/Toc/index.tsx b/src/client/theme-default/slots/Toc/index.tsx index c5c39370b0..f00a9aa4ab 100644 --- a/src/client/theme-default/slots/Toc/index.tsx +++ b/src/client/theme-default/slots/Toc/index.tsx @@ -23,7 +23,6 @@ const Toc: FC = () => { const { loading } = useSiteData(); const prevIndexRef = useRef(0); const [sectionRefs, setSectionRefs] = useState[]>([]); - const memoToc = React.useMemo(() => { let toc = meta.toc; if (tabMeta) { @@ -43,7 +42,7 @@ const Toc: FC = () => { setSectionRefs(refs as any); } - }, [pathname, search, loading]); + }, [pathname, search, loading, memoToc]); return sectionRefs.length ? (