Network error with axios and react native
It seems that unencrypted network requests are blocked by default in iOS, i.e. https
will work, http
will not.
From the docs:
By default, iOS will block any request that's not encrypted using SSL. If you need to fetch from a cleartext URL (one that begins with http) you will first need to add an App Transport Security exception.
If you are trying to call localhost on android simulator created with AVD, replacing localhost with 10.0.2.2 solved the issue for me.