React Native - Rest API calls using Axios - Mobile App development
Congratulations! You are standing in the right place! In this article, we will discuss how to use Axios to access the Rest API within a React application. We are going to create a mobile app like below, Implementation: You must set up your local development environment. Follow the below link to set up your local environment. https://www.knowledgefactory.net/2021/01/react-native-environment-setup-create-demo.html After executing the commands mentioned in this link , a folder with a specified name is created with the following contents. Next, we are going to edit the App.js file and write the below code. import React, { useEffect, useState } from 'react' ; import { FlatList, Text, View } from 'react-native' ; import axios from 'axios' export default App = () => { const [isLoading, setLoading] = useState( true ); const [data, setData] = useState([]); console.log(data); useEffect(() => { axios( 'https://raw.