Skip to content
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
11 changes: 10 additions & 1 deletion src/app/(marketing)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LandingWrapper } from "@/components/landing/LandingWrapper";
import { makePageMetadata } from "@/seo/metadata";

export const metadata = makePageMetadata({
Expand All @@ -7,5 +8,13 @@ export const metadata = makePageMetadata({
});

export default function MarketingLayout({ children }: { children: React.ReactNode }) {
return <>{children}</>;
return (
<html lang="ko">
<body>
<LandingWrapper>
<main className="flex-1">{children}</main>
</LandingWrapper>
</body>
</html>
Comment on lines +11 to +18

Choose a reason for hiding this comment

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

P1 Badge Remove nested html/body elements from marketing layout

This layout now returns <html> and <body> tags even though src/app/layout.tsx already provides the document shell. In Next.js app router only the root layout is allowed to render these elements; nested layouts should return fragments or semantic containers. Rendering another <html> inside the provider tree produces invalid markup and can trigger hydration warnings or build errors when navigating to marketing pages. Wrapping the children with LandingWrapper should happen inside a fragment instead.

Useful? React with πŸ‘Β / πŸ‘Ž.

);
}
10 changes: 10 additions & 0 deletions src/components/landing/LandingWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { cn } from "@/lib/utils";
import { LandingWrapperProps } from "@/types/landing";

export function LandingWrapper({ children, className }: LandingWrapperProps) {
return (
<div className={cn("min-h-screen flex flex-col bg-background text-foreground", className)}>
{children}
</div>
);
}
4 changes: 4 additions & 0 deletions src/types/landing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type LandingWrapperProps = {
children: React.ReactNode;
className?: string;
};