Every time you try using fetch(), to display data in ReactNative apps from a remote server, you’d come across this error. It can be solved by chaging few things in the fetch url.

the fetch url is ‘http://127.0.0.1:8000/api/movies/’

you can see the fetch(‘http://127.0.0.1:8000/api/movies/’) is as follows.

You have to change this to fetch(‘http://10.0.2.2:8000/api/movies/’). 10.0.2.2:port_no is the standard way for running android emulator.

I have been doing Full-Stack development for almost two years now. As, a programmer these are some of the things you’re not supposed to do.

Looking into others plate. As, such there is not success formula. So, never look into others life and try adapt it. Not only as…

Raghavi_bala

Full Stack Developer. React JS, Django REST, PostgreSQL.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store