page layouts
Unanswered
New Guinea Freshwater Crocodile posted this in #help-forum
New Guinea Freshwater CrocodileOP
If my layout.tsx file is directly in the src/app directory can I still use the nested page routing? Initially the pages are setup with page.tsx - should I be modifying the page name themselves to the intended component name? I did use page.tsx initially with export default function Dashboard for example and it was working, when I switched to nested routes I've broken something.
11 Replies
New Guinea Freshwater CrocodileOP
probably also worthwhile to note that the original page.tsx in the root of the app directory is no longer rendering on the
localhost:3000/ landing page.Komondor
can you share an example of the directory layout you're having problems with?
New Guinea Freshwater CrocodileOP
sure just a moment
in the root directory i have the layout.tsx which was setup upon bootstrapping the application,
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}I haven't modified this logic at all, is this the source of the issue?
my home page is just throwing 404 error
im trying to follow the documentation
New Guinea Freshwater CrocodileOP
alright so when i move the components out of the pages directory that i created
they load in to the application. why then does the documentation say that we can use a pages directory?
@New Guinea Freshwater Crocodile they load in to the application. why then does the documentation say that we can use a pages directory?
nested layout only work in the
app folder and the file name will be the pathname in pages folder