function useDocumentTitle
useDocumentTitle(title: string | null | undefined): void

Sets the tab's title to title ยท site name for the page that calls it, since a client-side navigation leaves the server's <title> in place. A page passes null for the bare site name, and undefined while its data loads, which keeps the title the server rendered for that URL rather than flashing the site name.

Parameters

title: string | null | undefined

Return Type

void

Usage

import { useDocumentTitle } from "src/hooks/shared/useDocumentTitle.ts";