alepha@docs:~/docs/reference/react-hooks$
cat useHead.md1 min read
Last commit:
#useHead
#Import
typescript
1import { useHead } from "alepha/react/head";
#Overview
tsx
1const App = () => { 2 const [head, setHead] = useHead({ 3 // will set the document title on the first render 4 title: "My App", 5 }); 6 7 return ( 8 // This will update the document title when the button is clicked 9 <button onClick={() => setHead({ title: "Change Title" })}>10 Change Title {head.title}11 </button>12 );13}