react-helmet icon indicating copy to clipboard operation
react-helmet copied to clipboard

Title change when out focus tab browser reactjs

Open VanTy207 opened this issue 4 years ago • 4 comments

Hello, I have a bug with the title of the helmet. When I run the app for the first time, and when I navigated to another page of the app, the title was normal, but the problem began to appear when I clicked on another tab and then returned, my title was changed to the default title.

Step description: page Home(title: home) (click) -> page Detail(title: detail) (click)->tab another of browser(title: home)

Version: "react": "^16.4.1", "react-dom": "^16.4.1", "react-helmet": "^5.2.1",

Thanks in advance!

VanTy207 avatar Apr 03 '20 12:04 VanTy207

Any update on this problem?

stijnwesterhof avatar Jul 17 '20 10:07 stijnwesterhof

I have a similar problem where I set the title to "Loading" whilst the page is loading, and then to the real title once the page loads. If this happens whilst the user is in another tab, the page stays at "Loading" until you click on the tab, even though the page has loaded.

Edit: Turns out this is a common issue, and is fixed just by adding defer={false} as a prop. More info here: https://github.com/nfl/react-helmet/issues/314#issuecomment-326056604

modulareverything avatar May 04 '21 15:05 modulareverything

http://localhost:3000/

patrickotto-sitel avatar Oct 02 '23 12:10 patrickotto-sitel

Thanks @modulareverything, came across your comment from Google and that solved it. IMO defer={false} should be the default; I don't see the use case.

FlorianCassayre avatar Mar 08 '24 09:03 FlorianCassayre