React hook for setting the document title
yarn add @chappy/use-document-title
npm install @chappy/use-document-titleimport { useDocumentTitle } from "@chappy/use-document-title";
const Foo = () => {
useDocumentTitle({ title: "Page Title" });
return <div />;
};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.