fix: move useDocumentTitle before early returns (Rules of Hooks)

This commit is contained in:
2026-06-11 12:59:13 +02:00
parent 5dc90724d3
commit 21cc6ed437
3 changed files with 3 additions and 4 deletions

View File

@@ -17,12 +17,12 @@ function PersonDetailPage() {
const { t } = useTranslation()
const { id } = Route.useParams()
const { data, isPending } = usePersonCredits(id)
useDocumentTitle(data?.person.name)
if (isPending) return <PersonSkeleton />
if (!data) return null
const { person, cast, crew } = data
useDocumentTitle(person.name)
return (
<div className="space-y-4 p-4">