I am newbie to react native. Recently I am thinking of building a cross-platform mobile app. I am already developing backend rest API in Django. Is it possible to use react native in this case ? If not, what would my other choices ?
Yes, it is. You have to use fetch
in order to use your API. The most important thing is that your API returns JSON (ideally) or another response that can be handled by Javascript (HTML, XML, ...).
Here you have a tiny example about how to fetch data from your API in React Native.
fetch('http://your-django-api-url.com/endpoint?query=id')
.then((response) => {
return response.json()
})
More information here: https://facebook.github.io/react-native/docs/network.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With