{"name":"react-document-title","version":"1.0.2","description":"A declarative, nested, stateful document.title for React","main":"index.js","peerDependencies":{"react":">=0.11.0 || >=0.13.0-beta.1"},"scripts":{"test":"mocha","lint":"jshint index.js test"},"repository":{"type":"git","url":"https://github.com/gaearon/react-document-title.git"},"keywords":["react","component","react-component","document.title","title","jsx"],"author":{"name":"Dan Abramov","email":"dan.abramov@me.com","url":"http://github.com/gaearon"},"license":"MIT","bugs":{"url":"https://github.com/gaearon/react-document-title/issues"},"homepage":"https://github.com/gaearon/react-document-title","devDependencies":{"expect.js":"^0.3.1","global":"^4.3.0","jshint":"^2.5.6","mocha":"^2.0.1","react":"^0.13.0-beta.1"},"dependencies":{"react-side-effect":"~0.3.0"},"_id":"react-document-title@1.0.2","_shasum":"8a4b61ff28172c87d3eec75a82339ec719365226","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"gaearon","email":"dan.abramov@gmail.com"},"maintainers":[{"name":"gaearon","email":"dan.abramov@gmail.com"}],"dist":{"shasum":"8a4b61ff28172c87d3eec75a82339ec719365226","tarball":"http://registry-npm.ywwl.com/react-document-title/download/react-document-title-1.0.2.tgz","integrity":"sha512-JVeZUdBplJKSDZmugeweN99EqYMiOL/LblbAH9RKN/mYMHgHWCqjYF8qTI7dSsOZtek51rBDgnxZ9CsVT+vUtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoQgJVvUbr4zT5ZWnw+2M6W1P7ETx4Y1ItelZuJiEPiAIgIBN+v26tCEDXpfhatrvABMRwPTHVpun5Vu8xBdvWXSo="}],"size":3972,"noattachment":false,"key":"/react-document-title/-/react-document-title-1.0.2.tgz"},"directories":{},"readme":"React Document Title\n====================\n\nProvides a declarative way to specify `document.title` in a single-page app.  \nThis component can be used on server side as well.\n\nBuilt with [React Side Effect](https://github.com/gaearon/react-side-effect).\n\n====================\n\n## Installation\n\n```\nnpm install --save react-document-title\n```\n\nDependencies: React >= 0.13.0\n\n## Features\n\n* Does not emit DOM, not even a `<noscript>`;\n* Like a normal React compoment, can use its parent's `props` and `state`;\n* Can be defined in many places throughout the application;\n* Supports arbitrary levels of nesting, so you can define app-wide and page-specific titles;\n* Works just as well with isomorphic apps.\n\n## Example\n\nAssuming you use something like [react-router](https://github.com/rackt/react-router):\n\n```javascript\nvar App = React.createClass({\n  render: function () {\n    // Use \"My Web App\" if no child overrides this\n    return (\n      <DocumentTitle title='My Web App'>\n        <this.props.activeRouteHandler />\n      </DocumentTitle>\n    );\n  }\n});\n\nvar HomePage = React.createClass({\n  render: function () {\n    // Use \"Home\" while this component is mounted\n    return (\n      <DocumentTitle title='Home'>\n        <h1>Home, sweet home.</h1>\n      </DocumentTitle>\n    );\n  }\n});\n\nvar NewArticlePage = React.createClass({\n  mixins: [LinkStateMixin],\n\n  render: function () {\n    // Update using value from state while this component is mounted\n    return (\n      <DocumentTitle title={this.state.title || 'Untitled'}>\n        <div>\n          <h1>New Article</h1>\n          <input valueLink={this.linkState('title')} />\n        </div>\n      </DocumentTitle>\n    );\n  }\n});\n```\n\n## Server Usage\n\nIf you use it on server, call `DocumentTitle.rewind()` **after rendering components to string** to retrieve the title given to the innermost `DocumentTitle`. You can then embed this title into HTML page template.\n\nBecause this component keeps track of mounted instances, **you have to make sure to call `rewind` on server**, or you'll get a memory leak.\n\n## But What About Meta Tags?\n\nLooking for something more powerful? Check out [React Helmet](https://github.com/nfl/react-helmet)!\n","publish_time":1424608683549,"_cnpm_publish_time":1424608683549,"dist-tags":{"latest":"2.0.3"}}