next.js
next.js copied to clipboard
Next 13: Issue with title
Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Mon Sep 19 19:14:52 UTC 2022 Binaries: Node: 16.15.0 npm: 8.5.5 Yarn: 3.2.4 pnpm: N/A Relevant packages: next: 13.0.2-canary.0 eslint-config-next: 13.0.0 react: 18.2.0 react-dom: 18.2.0
What browser are you using? (if relevant)
Chrome 107.0.5304.87
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
Having an SVG that includes <title> tag makes the document title to use this <title> instead of the one defined in the layout.tsx file within the HTML <title> tag.
Expected Behavior
I should use the HTML <title> within layout.tsx and not the <title> within an SVG element
Link to reproduction
https://codesandbox.io/s/ecstatic-poitras-tj7rhn
To Reproduce
- Create next 13 application
- Create a layout and add your title
- Create a SVG component that has a
<title>tag - Insert this SVG in your main page
- Navigate/redirect/refresh between your pages
- You should see that when accessing the page that contains this SVG makes the document title change to the title within the tag of the SVG