Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App router migration root layout #1085

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Metadata } from 'next';

// Nextjs automatically includes for each route two default meta tags, charset and viewport
// https://nextjs.org/docs/app/building-your-application/optimizing/metadata#default-fields
export const metadata: Metadata = {
title: 'Bloom',
};

export default function RootLayout({
// Layouts must accept a children prop.
// This will be populated with nested layouts or pages
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the impact of setting lang="en" on a multi-lingual site? Might be worth making a TODO to address this later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once i18n is added the value will be set to locale. It is good to add a value for a11y reasons the issue is when the selected locale is not English (the default one) as not all the content within the site is translated to all available languages

<body>{children}</body>
</html>
);
}
3 changes: 3 additions & 0 deletions app/public-route-test/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default async function Page() {
return <div>PUBLIC TESTING PAGE</div>;
}
1 change: 1 addition & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
Copy link
Contributor

@eleanorreem eleanorreem Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @boodland what is this line doing? I saw this issue but not sure if its related

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @eleanorreem, doesn't looks like as there isn't any empty folder within app one. It is automatically added when running yarn dev command, try to remove the line and run the command to see if it is also adding it for you, if it is the case, I would say is a reference that app router uses and needs to have in the definitions file


// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
Loading