I saw something cool within the React Navigation type.d.ts file and wondered how I could recreate some of the functionality.
It's this line I'm trying to understand
export declare type StackNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = string> = NavigationProp<ParamList, RouteName, StackNavigationState<ParamList>, StackNavigationOptions, StackNavigationEventMap> & StackActionHelpers<ParamList>;
It seems that the StackNavigationProp can be a unique prop depending on the string that it's given for example 'Welcome'.
type RootStackParamList = { Welcome: undefined; SignUp: undefined; Forgot: undefined;};interface RootScreenProps { navigation:StackNavigationProp<RootStackParamList, 'Welcome'>}
Is there anyone out there who understands this better and could write up a simple example?