fix(v2): keep mobile TOC after hydration (#5229)

This commit is contained in:
Alexey Pyltsyn 2021-07-28 16:34:45 +03:00 committed by GitHub
parent a7618c7758
commit a72ed73d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,9 +59,6 @@ function DocItem(props: Props): JSX.Element {
const canRenderTOC =
!hideTableOfContents && DocContent.toc && DocContent.toc.length > 0;
const renderTocMobile =
canRenderTOC && (windowSize === 'mobile' || windowSize === 'ssr');
const renderTocDesktop =
canRenderTOC && (windowSize === 'desktop' || windowSize === 'ssr');
@ -83,7 +80,7 @@ function DocItem(props: Props): JSX.Element {
</span>
)}
{renderTocMobile && (
{canRenderTOC && (
<TOCCollapsible
toc={DocContent.toc}
className={styles.tocMobile}