Function :
async function ridirect(APIresponse) {
const { navigate } = this.props.navigation;
if(APIresponse.success == true){
navigate('HomeBottomBar')
}
}
this function was getting error.
Function :
async function ridirect(APIresponse) {
const { navigate } = this.props.navigation;
if(APIresponse.success == true){
navigate('HomeBottomBar')
}
}
this function was getting error.
It's you're not passing the navigation prop to the component. You could use Navigation Context to pass navigation to the function.
E.g.:
import { NavigationContext } from '@react-navigation/native';
async function ridirect(APIresponse) {
const contextType = NavigationContext;;
if(APIresponse.success == true){
navigate('HomeBottomBar')
}
}