useDocumentTitle
Dynamically update the document title of a webpage.
The useDocumentTitle
hook is helpful when you want to dynamically update the document title based on a current state or data.
useDocumentTitle
Count is : 0
**Check the document titleUsage
Import the hook from @abhushanaj/react-hooks
and use in required component.
With config options
API Reference
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
title | string | The title to set for the document. | N/A |
options | DocumentTitleOptions (optional) | The configuration options. | undefined |
Types Reference
1. DocumentTitleOptions
Parameter | Type | Description | Default |
---|---|---|---|
resetOnUnmount | boolean | Whether to reset to the original title after unmount. | false |