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

@@ -30,12 +30,12 @@ function MovieDetailPage() {
const { data, isPending } = useMovie(id)
const { data: profile } = useMovieProfile(id)
const { data: history } = useMovieHistory(id)
useDocumentTitle(data?.movie.title)
if (isPending) return <DetailSkeleton />
if (!data) return null
const { movie, stats, reviews } = data
useDocumentTitle(movie.title)
const hasStats = profile && (profile.budget_usd != null || profile.revenue_usd != null || profile.vote_average != null)
return (