Skip to content

Commit 7fb4c81

Browse files
committed
fix: preserve browser history across Learn routes
1 parent e7796da commit 7fb4c81

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/app/layout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ const FONT_PRELOADS = [
161161
export default function RootLayout({children}: {children: React.ReactNode}) {
162162
const gaId = process.env.NEXT_PUBLIC_GA_TRACKING_ID;
163163
return (
164-
<html lang={siteConfig.languageCode} dir={siteConfig.isRTL ? 'rtl' : 'ltr'}>
164+
<html
165+
lang={siteConfig.languageCode}
166+
dir={siteConfig.isRTL ? 'rtl' : 'ltr'}
167+
suppressHydrationWarning>
165168
<head>
166169
<script
167170
id="theme-init"

src/app/learn/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function LearnLayout({children}: {children: React.ReactNode}) {
2828
<SidebarNav routeTree={routeTree} breadcrumbs={breadcrumbs} />
2929
</div>
3030
</div>
31-
{children}
31+
<React.Fragment key={pathname}>{children}</React.Fragment>
3232
</div>
3333
</>
3434
);

0 commit comments

Comments
 (0)