React Hooks
    Preparing search index...

    Interface DocumentTitleOptions

    Options to configure the behavior of useDocumentTitle

    interface DocumentTitleOptions {
        restoreOnUnmount?: boolean;
        template?: string;
        skipIfSame?: boolean;
    }
    Index

    Properties

    restoreOnUnmount?: boolean

    Whether to restore the original document title when the component unmounts.

    If this value changes dynamically, the hook will respect the latest value on unmount.

    true
    
    template?: string

    Optional template for the title, Use %s as a placeholder for the title.

    All occurrences of %s will be replaced by the provided title.

    template: '%s - MyApp'
    
    template: '%s - %s - MyApp'
    
    skipIfSame?: boolean

    If true, the hook will skip updating the title if the new title is identical to the current document.title.

    true