Skip to content

Commit 41d8178

Browse files
committed
Wrap left nav in Suspense too
1 parent ac4d30f commit 41d8178

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

beta/src/components/Layout/Sidebar/Sidebar.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,25 @@ export function Sidebar({isMobileOnly}: {isMobileOnly?: boolean}) {
3232
isOpen ? 'block z-40' : 'hidden lg:block'
3333
)}
3434
aria-hidden={isHidden}>
35-
<div className="px-5">
36-
<Search />
37-
</div>
38-
<nav
39-
role="navigation"
40-
ref={menuRef}
41-
style={{'--bg-opacity': '.2'} as React.CSSProperties} // Need to cast here because CSS vars aren't considered valid in TS types (cuz they could be anything)
42-
className="w-full h-screen lg:h-auto flex-grow pr-0 lg:pr-5 pt-6 pb-44 lg:pb-0 lg:py-6 md:pt-4 lg:pt-4 overflow-y-scroll lg:overflow-y-auto scrolling-touch scrolling-gpu">
43-
{isMobileSidebar ? (
44-
<MobileNav />
45-
) : (
46-
<SidebarRouteTree routeTree={routeTree} />
47-
)}
48-
</nav>
49-
<div className="sticky bottom-0 hidden lg:block">
50-
<Feedback />
51-
</div>
35+
<React.Suspense unstable_avoidThisFallback={true} fallback={null}>
36+
<div className="px-5">
37+
<Search />
38+
</div>
39+
<nav
40+
role="navigation"
41+
ref={menuRef}
42+
style={{'--bg-opacity': '.2'} as React.CSSProperties} // Need to cast here because CSS vars aren't considered valid in TS types (cuz they could be anything)
43+
className="w-full h-screen lg:h-auto flex-grow pr-0 lg:pr-5 pt-6 pb-44 lg:pb-0 lg:py-6 md:pt-4 lg:pt-4 overflow-y-scroll lg:overflow-y-auto scrolling-touch scrolling-gpu">
44+
{isMobileSidebar ? (
45+
<MobileNav />
46+
) : (
47+
<SidebarRouteTree routeTree={routeTree} />
48+
)}
49+
</nav>
50+
<div className="sticky bottom-0 hidden lg:block">
51+
<Feedback />
52+
</div>
53+
</React.Suspense>
5254
</aside>
5355
);
5456
}

0 commit comments

Comments
 (0)