mirror of
https://github.com/ershisan99/podcaster.git
synced 2025-12-16 12:33:43 +00:00
12 lines
241 B
TypeScript
12 lines
241 B
TypeScript
import { useEffect } from "react";
|
|
|
|
export function useTitle(title: string) {
|
|
useEffect(() => {
|
|
const prevTitle = document.title;
|
|
document.title = title;
|
|
return () => {
|
|
document.title = prevTitle;
|
|
};
|
|
}, [title]);
|
|
}
|