useTitle
Introduction
- useTitle makes setting page/document title easier.
- You can set different titles for your all components.
useTitle({
title: "UseTitleExample",
setOldTitleOnUnmount: true
});
Getting Started
- This hook is simple page title setter hook. You may want to use this for a quick usage.
- You need to import useTitle.
From Collection
import { useTitle} from "@reactivers/hooks";
From Package
import { useTitle} from "@reactivers/use-title";
Interfaces
Props
interface IUseTitleProps {
//Page title
title?: string;
//Reverts to last title on component unmount if passed True.
setOldTitleOnUnmount?: boolean; // Default = False
}
Returns
interface IUseTitleReturns {
//Return page title
title: string
//Sets page title
setTitle: (newTitle: string) => void;
}
Example