refactor: improve TypeScript type safety for router navigation

Replaces generic `any` type casts with specific route pattern types to enhance type checking and prevent invalid navigation paths.

Adds backward compatibility alias for the navigation utility function to maintain existing API contracts while improving code organization.
This commit is contained in:
Uruk
2025-09-29 23:20:30 +02:00
parent f16baeb226
commit 184f639920
2 changed files with 5 additions and 2 deletions

View File

@@ -307,7 +307,7 @@ export const AppleTVCarousel: React.FC<AppleTVCarouselProps> = ({
const navigateToItem = useCallback(
(item: BaseItemDto) => {
const navigation = getItemNavigation(item, "(home)");
router.push(navigation as any);
router.push(navigation as `/(auth)/(tabs)/${string}`);
},
[router],
);