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
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
Post a Comment