Hi,
How we can add more theme color's other than that are specified types in types
There are different methods the method i followed is by adding a global.d.ts fil e in type folder in src and mentioning the colors needed types there and extending the theme class of react navigation
import '@react-navigation/native';
// Override the theme in react native navigation to accept our custom theme props.
declare module '@react-navigation/native' {
export type Theme = {
dark: boolean;
colors: {
primary: string;
background: string;
background2: string;
card: string;
btColor: string;
text: string;
text2: string;
border: string;
notification: string;
};
};
export function useTheme(): Theme;
}
Top comments (0)