Skip to content

Commit abf3edc

Browse files
committed
fix(): Sidebar and NavbarSidebar lazy loading
1 parent 44c4260 commit abf3edc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docusaurus-theme/src/theme/DocSidebar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function DocSidebar({
297297
const windowSize = useWindowSize();
298298

299299
const shouldLoadSidebar =
300-
windowSize === windowSizes.mobile && mobileSidebarLoaded;
300+
windowSize === windowSizes.mobile ? mobileSidebarLoaded : true;
301301

302302
useLockBodyScroll(mobileSidebarOpen);
303303

src/theme/Navbar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function Navbar(): JSX.Element {
9999
const windowSize = useWindowSize();
100100

101101
const shouldLoadNavbarSidebar =
102-
mobileNavbarSidebarLoaded && windowSize === windowSizes.mobile;
102+
windowSize === windowSizes.mobile ? mobileNavbarSidebarLoaded : true;
103103

104104
useEffect(() => {
105105
if (windowSize === windowSizes.desktop) {

0 commit comments

Comments
 (0)