{"name":"react-document-title","version":"0.1.2","description":"A declarative, nested, stateful document.title for React","main":"index.js","peerDependencies":{"react":">=0.11.0"},"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.11.2"},"gitHead":"44b3e0688ddddb43fa6317bc3c7354796c6887d1","_id":"react-document-title@0.1.2","_shasum":"cd053cab525487f8c4bdc7d06c3921c4dbb12664","_from":"./","_npmVersion":"1.4.14","_npmUser":{"name":"gaearon","email":"dan.abramov@gmail.com"},"maintainers":[{"name":"gaearon","email":"dan.abramov@gmail.com"}],"dist":{"shasum":"cd053cab525487f8c4bdc7d06c3921c4dbb12664","tarball":"http://registry-npm.ywwl.com/react-document-title/download/react-document-title-0.1.2.tgz","integrity":"sha512-l3t4MLg8Sx1IA4vHLutmd5BqzOHgL59OXlh7vyihaWwYTFZghFOIuOGcunorCJOevXNCB5jCfNXK2CeO5fJA4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwesaFVbFH0NDwJHBmh+SZYGztLLOs+bspaktVdcQuRAiEAz2K9YFMZdwvtAOMNkvqtHMb7wz3Le+AoE3GBLenfIv8="}],"size":4132,"noattachment":false,"key":"/react-document-title/-/react-document-title-0.1.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":1414080298994,"_cnpm_publish_time":1414080298994,"dist-tags":{"latest":"2.0.3"}}