I am getting the ERROR:
[TypeError: Network request failed]
in my react native expo app js file for API Integration. The same API using in my react js web development it works well. But It didn't work in my react native expo mobile app.
I am getting the ERROR:
[TypeError: Network request failed]
in my react native expo app js file for API Integration. The same API using in my react js web development it works well. But It didn't work in my react native expo mobile app.
KTas
On
Don't reference localhost from your app - instead during local development you can directly specify the IP address. Luckily you can get this at runtime using expo-constants.
import Constants from "expo-constants";
const { manifest } = Constants;
const uri = `http://${manifest.debuggerHost.split(':').shift()}:3000`;
Copyright © 2021 Jogjafile Inc.
Don't use Local host address. Using public IPv4 address.