Relative Content

Tag Archive for react-nativereact-hooksaxiosreact-navigation

Navigation not getting called in useEffect hook

I am trying to call the navigation function to navigate the user from screen A to screen B if API returns the error 404. If the user has not created the profile then API will return the error 404 status code and I will catch it in the catch block then I will check if the status code is 404 if yes then I will navigate the user to create profile screen. So I am getting 404 and console logs are getting printed in the terminal but at first render, it’s not navigating the user or the function is not being called.