mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-25 05:03:07 +00:00
[Beta] Enable Selective Hydration in more places (#4689)
* [Beta] Enable Selective Hydration in more places * Fix typo
This commit is contained in:
@@ -57,7 +57,10 @@ export function MobileNav() {
|
||||
API
|
||||
</TabButton>
|
||||
</div>
|
||||
<SidebarRouteTree routeTree={tree as RouteItem} isMobile={true} />
|
||||
{/* No fallback UI so need to be careful not to suspend directly inside. */}
|
||||
<React.Suspense fallback={null}>
|
||||
<SidebarRouteTree routeTree={tree as RouteItem} isMobile={true} />
|
||||
</React.Suspense>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,14 +26,17 @@ export function Page({routeTree, children}: PageProps) {
|
||||
<Sidebar />
|
||||
</div>
|
||||
|
||||
<div className="flex flex-1 w-full h-full self-stretch">
|
||||
<div className="w-full min-w-0">
|
||||
<main className="flex flex-1 self-stretch mt-16 sm:mt-10 flex-col items-end justify-around">
|
||||
{children}
|
||||
<Footer />
|
||||
</main>
|
||||
{/* No fallback UI so need to be careful not to suspend directly inside. */}
|
||||
<React.Suspense fallback={null}>
|
||||
<div className="flex flex-1 w-full h-full self-stretch">
|
||||
<div className="w-full min-w-0">
|
||||
<main className="flex flex-1 self-stretch mt-16 sm:mt-10 flex-col items-end justify-around">
|
||||
{children}
|
||||
<Footer />
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</React.Suspense>
|
||||
</div>
|
||||
</SidebarContext.Provider>
|
||||
</MenuProvider>
|
||||
|
||||
@@ -42,7 +42,10 @@ export function Sidebar() {
|
||||
{isMobileSidebar ? (
|
||||
<MobileNav />
|
||||
) : (
|
||||
<SidebarRouteTree routeTree={routeTree} />
|
||||
/* No fallback UI so need to be careful not to suspend directly inside. */
|
||||
<React.Suspense fallback={null}>
|
||||
<SidebarRouteTree routeTree={routeTree} />
|
||||
</React.Suspense>
|
||||
)}
|
||||
</nav>
|
||||
<div className="sticky bottom-0 hidden lg:block">
|
||||
|
||||
Reference in New Issue
Block a user