react-helmet instead
Deprecated. UseSimple function to isomorphically set the <title> on the server and the client in a React workflow.
Table of Contents generated with DocToc
Install
npm i -S react-document-head
Usage
A React component
Component { return <div /> }
On the server…
const content = Reactconst title = ReactdocumentHeadtitleconst html = `<html> <head> <title></title> </head> <body> <div id="app"≥ </div> </body></html>`
Options
<String>
title
Set the title. On the client, this sets document.title
, on the server, it sets a global: React.documentHead
.
Tests
Tests are in tape.
npm test
will run both server and browser testsnpm run test-browser
andnpm run test-server
run their respective testsnpm run tdd-server
will run the server tests on every file change.npm run tdd-browser
will run the browser tests on every file change.
Developing
To publish, run npm run release -- [{patch,minor,major}]
NOTE: you might need to sudo ln -s /usr/local/bin/node /usr/bin/node
to ensure node is in your path for the git hooks to work
Requirements
- npm > 2.0.0 So that passing args to a npm script will work.
npm i -g npm
- git > 1.8.3 So that
git push --follow-tags
will work.brew install git
License
Artistic 2.0 © Joey Baker