1.0.1 • Published 4 years ago

@chappy/use-document-title v1.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
4 years ago

@chappy/use-document-title

CircleCI

React hook for setting the document title

Install

yarn add @chappy/use-document-title
npm install @chappy/use-document-title

Usage

import { useDocumentTitle } from "@chappy/use-document-title";

const Foo = () => {
  useDocumentTitle({ title: "Page Title" });
  return <div />;
};

Arguments

useDocumentTitle({
  title: string
  revertOnUnmount: boolean
})
  • title: string The title you want to set the document to. useDocumentTitle observers this as a dependency.
  • revertOnUnmount: boolean Will revert to previous title on unmount.