mirror of
https://github.com/ershisan99/podcaster.git
synced 2025-12-16 20:59:26 +00:00
feat: add page titles
This commit is contained in:
11
src/hooks/use-title.ts
Normal file
11
src/hooks/use-title.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useEffect } from "react";
|
||||
|
||||
export function useTitle(title: string) {
|
||||
useEffect(() => {
|
||||
const prevTitle = document.title;
|
||||
document.title = title;
|
||||
return () => {
|
||||
document.title = prevTitle;
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user