@tanem/use-document-title
TypeScript icon, indicating that this package has built-in type declarations

1.0.158 • Public • Published

use-document-title

npm version build status coverage status npm downloads minzipped size

A React hook that sets the current title of the document.

Basic Usage

import useDocumentTitle from '@tanem/use-document-title'
import React from 'react'
import ReactDOM from 'react-dom'

const App = ({ title }) => {
  useDocumentTitle(title)
  return <div />
}

ReactDOM.render(<App title="New title" />, document.getElementById('root'))

Live Examples

API

Arguments

  • title - The new title of the document.

Example

useDocumentTitle('New title')

Installation

$ npm install @tanem/use-document-title --save

There are also UMD builds available via unpkg:

For the non-minified development version, make sure you have already included:

For the minified production version, make sure you have already included:

License

MIT

Package Sidebar

Install

npm i @tanem/use-document-title

Weekly Downloads

54

Version

1.0.158

License

MIT

Unpacked Size

13.3 kB

Total Files

15

Last publish

Collaborators

  • tanem