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.
2
Answers
Don't use Local host address. Using public IPv4 address.
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 usingexpo-constants
.