Skip to content

useTitle ​

A hook that set title of the page.

代码演示 ​

API ​

typescript
useTitle(title: string, options?: Options);

Params ​

PropertyDescriptionTypeDefault
titlePage titleRef<string>-

Options ​

PropertyDescriptionTypeDefault
restoreOnUnmountWhether to restore the previous page title when the component is unmountedbooleanfalse

Source ​

Source · Document · Demo

Released under the MIT License.