meta tag in Head from next/head is not working in app router next js #68692
Unanswered
dashranjin
asked this question in
Help
Replies: 2 comments 1 reply
-
Yeah, what gives? Why can’t I do this? Why is this a restriction? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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