You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the title tag is created in a sub-component inside the Head tag it get's set to nothing after the client side bundle takes over. When disabling the JS in the devtools you can see that when the SSR code is used the title tag is used correctly.
To Reproduce
Use the code below, load up the index page and you will see the title change from My title is set here to an empty string when the client side bundle takes over.
// Pages/index.js
import React from 'react';
import Head from "next/head";
import MetaTags from "./../components/MetaTags";
export default () => (
<Head>
<MetaTags />
</Head>
);
// components/MetaTags.js
import React, { Fragment } from 'react';
export default () => (
<Fragment>
<title>My title is set here</title>
</Fragment>
);
Expected behavior
Expect the client side code to behave like the SSR code when nesting a title tag in the Head component.
Screenshots
Example of loading the page from a new tab
Screenshot of DOM tree (JS turned off via Chrome devtools)
Screenshot of DOM tree (JS turned on)
System information
Version of Next.js: 7.0.2
Additional information
When putting the title tag directly in the Head component it works as expected
The text was updated successfully, but these errors were encountered:
nealoke
changed the title
Title tag get's unset on client side
Title tag gets unset on client side
Nov 8, 2018
Bug report
Describe the bug
When the
title
tag is created in a sub-component inside theHead
tag it get's set to nothing after the client side bundle takes over. When disabling the JS in the devtools you can see that when the SSR code is used thetitle
tag is used correctly.To Reproduce
Use the code below, load up the index page and you will see the title change from
My title is set here
to an empty string when the client side bundle takes over.Expected behavior
Expect the client side code to behave like the SSR code when nesting a
title
tag in theHead
component.Screenshots
Example of loading the page from a new tab
![title tag](https://user-images.githubusercontent.com/17417414/48201646-0fbb4a00-e363-11e8-9cdf-c2136d8d06fe.gif)
Screenshot of DOM tree (JS turned off via Chrome devtools)
![image](https://user-images.githubusercontent.com/17417414/48201720-3e392500-e363-11e8-8242-6a67558762ea.png)
Screenshot of DOM tree (JS turned on)
![image](https://user-images.githubusercontent.com/17417414/48201741-54df7c00-e363-11e8-95f1-82f37e7b9d1b.png)
System information
7.0.2
Additional information
When putting the
title
tag directly in theHead
component it works as expectedThe text was updated successfully, but these errors were encountered: