Updates the document.title for the current page.
document.title
This hook automatically updates the document title when mounted, and optionally restores the original title when unmounted.
The new title to set
Optional configuration
This hook uses React hooks internally:
import { useDocumentTitle } from '@tenedev/hooks';export function Dashboard() { useDocumentTitle('Dashboard', { template: '%s - MyApp' }); return <h1>Dashboard</h1>;}; Copy
import { useDocumentTitle } from '@tenedev/hooks';export function Dashboard() { useDocumentTitle('Dashboard', { template: '%s - MyApp' }); return <h1>Dashboard</h1>;};
0.2.0
Updates the
document.titlefor the current page.This hook automatically updates the document title when mounted, and optionally restores the original title when unmounted.