useTitle
set document title.
Usage
Live Editor
function Demo() { const [title, setTitle] = useState("title"); useTitle(title); return ( <div> <button onClick={() => setTitle("newTitle")}>Change Title</button> </div> ); };
Result
Loading...
API
useTitle
Returns
void
Arguments
Argument | Description | Type | DefaultValue |
---|---|---|---|
title | title | string (Required) | - |