In React Native, you can request data from an API over the network using the fetch() method . We are creating a function called getUsers, where we will fetch json data from rest api. We want to fetch the data as soon as the component mounts, so calling getUsers function in useEffect hook.