Created
October 30, 2023 15:32
-
-
Save GalindoSVQ/c8b3bfd55967dfb44ee4b3ba1a3df230 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect } from 'react'; | |
| export default function useDocumentTitle(title: string) { | |
| useEffect(() => { | |
| document.title = title; | |
| }, [title]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stackblitz URL: https://stackblitz.com/edit/vitejs-vite-jb4vcb?file=src%2FuseDocumentTitle.ts