diff --git a/src/utils/PageTitleContainer.tsx b/src/utils/PageTitleContainer.tsx index e20a2d42..b58d9ad7 100644 --- a/src/utils/PageTitleContainer.tsx +++ b/src/utils/PageTitleContainer.tsx @@ -1,8 +1,14 @@ import {useState} from 'react' import {createContainer} from 'unstated-next' +import {useUpdateEffect} from 'usehooks-ts' const usePageTitle = (initial = '') => { const [pageTitle, setPageTitle] = useState(initial) + + useUpdateEffect(() => { + setPageTitle(initial) + }, [initial]) + return {pageTitle, setPageTitle} }