Skip to content

useDocumentTitle ​

browser
test coverage
Last changed: last month

Hook that manages the document title and allows updating it

typescript
import { useDocumentTitle } from '@siberiacancode/reactuse';

Usage ​

typescript
const { value, set } = useDocumentTitle();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
initialValue?string-The initial title. If not provided, the current document title will be used
options.restoreOnUnmount?boolean-Restore the previous title on unmount

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarhywax
AvatarVitalij Ryndin

Released under the MIT License.