简体   繁体   中英

React.js see tab name only after tab is clicked?

in my React.js project I am using react-helmet to manage tab names. 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. 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

However helmet provides a defer prop which if you set to false, the requestAnimationFrame will be skipped

use it like

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

Linked github issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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