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]));