mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-30 14:14:17 +00:00
fix(v2): keep mobile TOC after hydration (#5229)
This commit is contained in:
parent
a7618c7758
commit
a72ed73d2d
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in New Issue