import type { NativeStackNavigationOptions } from "@react-navigation/native-stack"; import { Stack } from "expo-router"; import { type ReactNode, useMemo } from "react"; import { withUnistyles } from "react-native-unistyles"; interface ThemedStackBaseProps { backgroundColor: string; children?: ReactNode; screenOptions?: NativeStackNavigationOptions; } function ThemedStackBase({ backgroundColor, children, screenOptions }: ThemedStackBaseProps) { const themedScreenOptions = useMemo( () => ({ ...screenOptions, contentStyle: [{ backgroundColor }, screenOptions?.contentStyle], }), [backgroundColor, screenOptions], ); return {children}; } export const ThemedStack = withUnistyles(ThemedStackBase, (theme) => ({ backgroundColor: theme.colors.surface0, }));