简体   繁体   English

React.js 仅在单击选项卡后才看到选项卡名称?

[英]React.js see tab name only after tab is clicked?

in my React.js project I am using react-helmet to manage tab names.在我的 React.js 项目中,我使用 react-helmet 来管理选项卡名称。 Also I got a table with different page names.我还得到了一张不同页面名称的表格。 When I right click on those pages and open them in a new tab, I cannot see tab name until tab is clicked (see the pic below).当我右键单击这些页面并在新选项卡中打开它们时,在单击选项卡之前我看不到选项卡名称(见下图)。 So I need to see tab names right after right click and open in a new tab menu.所以我需要在右键单击并open in a new tab后立即查看选项卡名称。 Could anyone advice what is the reason for this and how this can be fixed?任何人都可以建议这是什么原因以及如何解决这个问题? Thank you.谢谢你。

标签

Helmet internally uses requestAnimationFrame which doesn't run for background tabs, so unless you focus on the tab the title won't change Helmet 在内部使用requestAnimationFrame ,它不会为后台选项卡运行,因此除非您专注于选项卡,否则标题不会改变

However helmet provides a defer prop which if you set to false, the requestAnimationFrame will be skipped然而,头盔提供了一个defer属性,如果你设置为 false,requestAnimationFrame 将被跳过

use it like像使用它

<Helmer defer={false}>
    {/* Your data */}
</Helmet>

Linked github issue链接 github 问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM