@supunlakmal/hooks
Version:
A collection of reusable React hooks
16 lines (15 loc) • 531 B
TypeScript
interface UseDocumentTitleOptions {
/**
* If true, the original document title will be restored when the component unmounts.
* Defaults to false.
*/
restoreOnUnmount?: boolean;
}
/**
* Sets the document title (`document.title`).
*
* @param {string} title The string to set as the document title.
* @param {UseDocumentTitleOptions} [options={ restoreOnUnmount: false }] Options for the hook.
*/
export declare function useDocumentTitle(title: string, options?: UseDocumentTitleOptions): void;
export {};