diff --git a/services/frontend/src/hooks/index.ts b/services/frontend/src/hooks/index.ts new file mode 100644 index 0000000..19097ee --- /dev/null +++ b/services/frontend/src/hooks/index.ts @@ -0,0 +1 @@ +export * from "./useTitle"; diff --git a/services/frontend/src/hooks/useTitle.ts b/services/frontend/src/hooks/useTitle.ts new file mode 100644 index 0000000..85e8210 --- /dev/null +++ b/services/frontend/src/hooks/useTitle.ts @@ -0,0 +1,7 @@ +import { useEffect } from "react"; + +export const useTitle = (title: string) => { + useEffect(() => { + document.title = title; + }, [title]); +};