I use a useTheme hook import { useTheme } from '@react-navigation/native'
from react-navigation
lib that returns colors
object that is a type of Theme
.
type Theme = { dark: boolean; colors: { primary: string; background: string; card: string; text: string; border: string; notification: string; };};
In a file, where we have all layout/styles related stuff, I have extended it with one more property:
interface ITheme extends Theme { colors: Theme['colors'] & { textSecondary: string; };}
How do i type cast it somehow it to a library type once, so the colors
object that is returned from useTheme
hook will become ITheme
custom type anywhere i call this hook?
It gives me Property 'textSecondary' does not exist on type '{ primary: string; background: string; card: string; text: string; border: string; notification: string; }'
error so far.