I am trying to pass data in hooks from one tab to previous (both screens are in the TabNavigator)
and using this official doc to send data to previous but due to some reason I am not getting any data in useEffect
At tabB
navigation.navigate('tabA', {rideStatus: 'start'});
at TabA I am trying to get this data like below
export default function PamentOption<MapsProps>({ route, navigation }) {
React.useEffect(() => {
if (route.params?.rideStatus) {
console.log('this is it')
}
}, [route.params?.rideStatus]);
}
it is going from one tab to another tab but can not get data