If you have updated your project to a newer version of React Native and all the API calls stopped working suddenly then update @react-native-community/netinfo library. It also causes problems.