When using a typed stack navigation there are no type warnings for the event being dispatched.
e.g.
const navigation = useNavigation<StackNavigationProp<'Stack.ScreenName'>>()
const goToScreen = () => {
navigation.dispatch(StackActions.push('Stack.AnotherScreenName'))
}
Some way to specify a type which will check that the arguments provided to the event creator or event dispatch are valid. I would expect this to be fairly manual, e.g.
type StackScreenArgs = {
'ScreenName': {
arg1: number;
arg2: number;
};
}
navigation.dispatch(
StackActions.push<StackScreenArgs>('ScreenName', {...screenArgs})
)