next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Next 13: Issue with title

Open alexvcasillas opened this issue 3 years ago • 0 comments

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

  1. Create next 13 application
  2. Create a layout and add your title
  3. Create a SVG component that has a <title> tag
  4. Insert this SVG in your main page
  5. Navigate/redirect/refresh between your pages
  6. 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

alexvcasillas avatar Nov 02 '22 10:11 alexvcasillas