From 8a44d2ff15db356c269ee8819eb7016de15e6dda Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Sat, 21 Dec 2024 12:31:00 +0100 Subject: [PATCH] fix: correct types --- components/stacks/NestedTabPageStack.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/components/stacks/NestedTabPageStack.tsx b/components/stacks/NestedTabPageStack.tsx index 12409ab0..b74c71af 100644 --- a/components/stacks/NestedTabPageStack.tsx +++ b/components/stacks/NestedTabPageStack.tsx @@ -1,6 +1,15 @@ +import { NativeStackNavigationOptions } from "@react-navigation/native-stack"; import { HeaderBackButton } from "../common/HeaderBackButton"; +import { ParamListBase, RouteProp } from "@react-navigation/native"; -const commonScreenOptions = { +type ICommonScreenOptions = + | NativeStackNavigationOptions + | ((prop: { + route: RouteProp; + navigation: any; + }) => NativeStackNavigationOptions); + +const commonScreenOptions: ICommonScreenOptions = { title: "", headerShown: true, headerTransparent: true, @@ -17,5 +26,5 @@ const routes = [ "series/[id]", ]; -export const nestedTabPageScreenOptions: { [key: string]: any } = +export const nestedTabPageScreenOptions: Record = Object.fromEntries(routes.map((route) => [route, commonScreenOptions]));