
Description
React Document Title is a small React component for setting document.title declaratively in a single-page app. You place a DocumentTitle element inside your components, and it sets the page title while it is mounted. It supports nesting, so an app-wide title can be set higher in the tree and a page-specific title lower down, and it can be defined in many places across the application. The component works on the server as well. After rendering to a string, you call DocumentTitle.rewind() to get the innermost title and embed it in your HTML template, and the README warns that rewind must be called on the server to avoid a memory leak. The component emits no DOM of its own and is built with React Side Effect. The README lists React 0.13.0 or later as a dependency. If you also need meta tags, the README points to React Helmet. The project is public on GitHub under the gaearon account.…
Highlights
- Declarative document.title for React
- Nested titles from app-wide to page-specific
- Server rendering with rewind
- No DOM output
- Built with React Side Effect
Ratings & Reviews
No ratings yet
Be the first to rate react-document-title.
People also visit
react-document-title FAQ
What does React Document Title do?
It sets document.title from React components, declaratively, with nested titles.
Which React version is needed?
The README lists React 0.13.0 or later as a dependency.
How do I use it on the server?
After rendering to a string, call DocumentTitle.rewind() to get the title and embed it in the page template. Calling rewind avoids a memory leak.
Can it set meta tags?
No. The README says it only sets the title and points to React Helmet for meta tags.
Is it open source?
The repository is public on GitHub under the gaearon account.
What are the best react-document-title alternatives?
Popular alternatives to react-document-title include react-titled, react-document-meta and react-meta-tags. See all react-document-title alternatives

















