Skip to content

Commit

Permalink
Fix non-changing title for competitions (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matushl authored Dec 10, 2023
1 parent 521cbc0 commit 3b407a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/PageTitleContainer.tsx
Original file line number Diff line number Diff line change
@@ -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}
}

Expand Down

0 comments on commit 3b407a6

Please sign in to comment.