[#754,landing page][s]: fix build errors

This commit is contained in:
deme
2023-04-18 08:27:46 -03:00
parent b3293625a4
commit 43cc641d1d
4 changed files with 12 additions and 10 deletions

View File

@@ -19,12 +19,13 @@ export default function DRDPage({ source, frontMatter }) {
const [tableOfContents, setTableOfContents] = useState([]);
useEffect(() => {
const headingNodes = document.querySelectorAll('h2,h3');
const headingNodes = document.querySelectorAll(
'h2,h3'
) as NodeListOf<HTMLHeadingElement>;
const toc = collectHeadings(headingNodes);
setTableOfContents(toc ?? []);
}, [router.asPath]); // update table of contents on route change with next/link
return (
<Layout tableOfContents={tableOfContents} title={frontMatter.title}>
<MDXPage source={source} frontMatter={frontMatter} />