-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Next 13: unable to change <title> with head.tsx when one is specified in layout.tsx #42239
Comments
Try to define your title on a variable and then use:
Mixing variables and text inside <title> was my problem. |
That is a different bug I think, even when I only use a variable, it doesn't overwrite the title specified in the layout. |
I'm having this problem too. export default function Head () {
return (
<>
<title>Art Site</title>
</>
);
} and app/shop/head.tsx export default function Head () {
return (
<>
<title>Art Store</title>
</>
);
} And the title never changes unless i type into the url /shop and hit enter. or unless i refresh the page. In those 2 instances it loads with the right title then, but not on navigation. |
I'm having the same/a similar issue. Each of my Note I'm using "use client" in my pages as I don't care about SSR for them. |
Updating to the atm latest next version (13.0.6) solved the issue for me. |
This is still happening to me on next 13.1.1. |
Hey y'all, if you're using next 13 with app directory, it works differently now and uses a 'special files' approach. If you found this thread, you may be trying to use the old way. Instead of providing a tag in your page JSX, you create a separate file See: https://beta.nextjs.org/docs/api-reference/file-conventions/head |
Looks like |
Close per above replies for moving to metadata API as the replacement of |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Firefox 107.0b7
How are you deploying your application? (if relevant)
No response
Describe the Bug
When using the new app directory, I'm unable to set a <title> like it is described here https://beta.nextjs.org/docs/routing/pages-and-layouts#modifying-head when there is already one defined in a layout.tsx file.
Expected Behavior
I'd assume that a <title> tag in a head.tsx file would overwrite the layout <title>
Link to reproduction
https://github.com/johnrackles/next13-title-tag
To Reproduce
Remove line 5 in layout.tsx and the title change happens from within head.tsx
The text was updated successfully, but these errors were encountered: