1.0.1 • Published 6 years ago
@chappy/use-document-title v1.0.1
@chappy/use-document-title
React hook for setting the document title
Install
yarn add @chappy/use-document-title
npm install @chappy/use-document-titleUsage
import { useDocumentTitle } from "@chappy/use-document-title";
const Foo = () => {
useDocumentTitle({ title: "Page Title" });
return <div />;
};Arguments
useDocumentTitle({
title: string
revertOnUnmount: boolean
})title: stringThe title you want to set the document to.useDocumentTitleobservers this as a dependency.revertOnUnmount: booleanWill revert to previous title on unmount.