fix(tv): type lastSegment as string for typed-routes index check

This commit is contained in:
Gauvain
2026-07-04 18:21:10 +02:00
parent a39637f187
commit 03b2aec931

View File

@@ -50,7 +50,9 @@ function TVTabLayout() {
const router = useRouter();
const currentTab = segments.find(isTabRoute);
const lastSegment = segments[segments.length - 1] ?? "";
// Widened to string: typed routes omit "index" segments, but they can still
// appear at runtime, so keep the guard without tripping TS2367.
const lastSegment: string = segments[segments.length - 1] ?? "";
const atTabRoot = isTabRoute(lastSegment) || lastSegment === "index";
const tabs: TVNavBarTab[] = useMemo(