I'm using Nextjs 14.2.5 app router. Per documentation on layouts, "On navigation, layouts preserve state, remain interactive, and do not re-render." When navigating to or between nested routes, layout does not re-render, but when navigating back to root (home) layout re-renders.
Running locally there is no issue, but deployed to gh-pages, layout reloads when navigating to root.
Am I missing something or not understanding how root layout.js files work? or does it have to do with gh-pages?
project
└─ app
├─ about
│ └─ page.js
├─ contact
│ └─ page.js
├─ layout.js
├─ page.js
layout.js
import { Inter } from "next/font/google";
import "@/app/globals.css";
import Head from "next/head";
import Header from "@/_components/header";
import Footer from "@/_components/footer";
import { basePath } from "@/scripts/basepath.js";
const inter = Inter({ subsets: ["latin"] });
export const meta = {
title: "",
description: "",
image: `${basePath}/`,
};
export default function RootLayout({ children }) {
return (
<html lang='en' className='dark' data-theme='dark'>
<Head>
</Head>
<body className={`${inter.className}`}>
<Header />
{children}
<Footer />
</body>
</html>
);
}