I am using ReactNavigation v6 along with typescript
I have created a helper functions as
export function navigate(routeName, routeParams) {
navigationRef.current?.navigate(routeName, routeParams);
}
What type should I specify for routeName & routeParams such that it type checks these params correctly?
I have the following types for my StackNavigator
export type StackNavigator = {
Welcome: undefined;
Username: undefined;
Password: undefined;
ForgotPassword: {id: number};
};