rooks
Version:
Collection of awesome react hooks
21 lines (20 loc) • 731 B
TypeScript
type UseDocumentTitleOptions = {
resetOnUnmount?: boolean;
};
/**
* useDocumentTitle hook
*
* This hook allows you to set the document title.
*
* @param title - The new title for the document
* @param options - An optional object with a `resetOnUnmount` property to control whether the document title should be reset to its previous value when the component is unmounted. Defaults to false.
*
* @example
* function App() {
* useDocumentTitle("My App", { resetOnUnmount: true });
* return <div>Hello, world!</div>;
* }
* @see {@link https://rooks.vercel.app/docs/hooks/useDocumentTitle}
*/
declare function useDocumentTitle(title: string, options?: UseDocumentTitleOptions): void;
export { useDocumentTitle };