meta tag in Head from next/head is not working in app router next js #68692
Replies: 1 comment 1 reply
-
That should work
|
Beta Was this translation helpful? Give feedback.
-
That should work
|
Beta Was this translation helpful? Give feedback.
-
Verify canary release
Provide environment information
Which example does this report relate to?
layout.tsx
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
the meta tags in next js page router was working fine and not in app router layout
Expected Behavior
import "@/styles/globals.css";
import type { AppProps } from "next/app";
import Head from "next/head";
export default function App({ Component, pageProps }: AppProps) {
return (
<>
<title>Ttitle</title>
);
}
To Reproduce
"use client";
import { Rubik } from "next/font/google";
import "./globals.css";
import Head from "next/head";
const rubik = Rubik({
subsets: ["latin", "cyrillic"],
weight: ["300", "400", "500", "600", "700", "800", "900"],
});
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<>
<title>Title</title>
<body className={rubik.className + " fixed h-screen w-screen"}>
{children}
</>
);
}
Beta Was this translation helpful? Give feedback.
All reactions