I started using typescript in my react native project (typescript newbie) and hit a problem with navigationOptions in functional component with typescript, i solved it thanks to this post here however when i try to pass redux props its telling me
Property 'authType' does not exist on type 'PropsWithChildren<NavigationStackScreenProps<Params, Props>>
this is my code
interface Props {
authType: string;
}
interface Params {
routeName: string;
}
const Customer: NavigationStackScreenComponent<Params, Props> = ({
navigation,
authType,
}) => {
.... Component
}
Customer.navigationOptions = ({ navigation }) => ({
title: navigation.getParam('routeName'),
});
I think this means that the prop i am passing is not being read although i am passing it.
I used NavigationStackScreenComponent in order to be able to use
Customer.navigationOptions etc
otherwise its gonna tell me
ts] Property 'navigationOptions' does not exist
I am really beggining to love typescript , Any idea how to use authType Props without it screaming at me ?