React-helmet: Title doesn't update when opening in a new tab until focused

Created on 13 Sep 2017  路  3Comments  路  Source: nfl/react-helmet

When opening a link from my app in a new tab (via cmd+click for example), the new tab title is not correctly updated from its default title. When selecting the tab, the title gets updated correcly.
It seems to be cause by the introduction of requestAnimationFrame in the pull request #307. At least in chrome, requestAnimationFrame is not executed on background tabs.
I've tested with a previous version (5.0.0), which has the correct behaviour.
(bug observed by @samuelmartineau)

Most helpful comment

I just realized that there's another issue related to this that was answered already: https://github.com/nfl/react-helmet/issues/314.

_TL;DR:_ add defer={false} prop to skip requestAnimationFrame.

All 3 comments

I just realized that there's another issue related to this that was answered already: https://github.com/nfl/react-helmet/issues/314.

_TL;DR:_ add defer={false} prop to skip requestAnimationFrame.

This solution still works, but it's not documented in the README.

Was looking for this as well, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olalonde picture olalonde  路  3Comments

michaelBenin picture michaelBenin  路  3Comments

sneridagh picture sneridagh  路  4Comments

lyquocnam picture lyquocnam  路  3Comments

aequasi picture aequasi  路  3Comments