Environment
I'm developing a mobile app with React Native and Expo.
Also, developing api with Laravel that is in my local environment. (http://localhost:8000/)
This app is working on Expo client app.
What I'm trying to do
I wanna get datas from api.
Code
App.js
componentDidMount() {
return fetch('http://localhost:8000/api/test')
.then((response) => response.json())
.then((responseJson) => {
console.log(responseJson);
})
.catch((error) => {
console.error(error);
});
}
Error
TypeError: Network request failed
Expo version
3.22.3
I would appreciate it if you could give me any advice.