javascript - How change the title of a page before it loads JSX -


i want change title of class, , achieve document.title = "flayers" put code in constructor,then firt have default title , change when refer url, show old title.

first have title

enter image description here

next change enter image description here

and when refer url : enter image description here

i don't know if explain :d

are familiar react-router? can change name of title page placing componentdidmount in desired component, fire when component loaded. then, you'll use document.title target , change page's title.

here's example, took issue ticket #49 in react-router github repository:

var handler = react.createclass({ componentdidmount: function() { document.title = "amazing page"; } }); 

Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -