I have a screen that used in two navigators and wanna make navigation.navigate to previous screen with passig some data. I've tried something like this:
const {routeNames, index} = useNavigationState(state => state);navigation.navigate(routeNames[index-1], {data: 'some data'})
It does not work and throws error Type 'string' is not assignable to type 'keyof AuthParamList'.