Answer the question
In order to leave comments, you need to log in
How to set up fetch in React Native?
React Navite throws this error:
Promise {
"_40": 0,
"_55": null,
"_65": 0,
"_72": null,
}
export const AuthLogin = async (data) => {
console.log('Данные для сервера', data)
try {
let response = await fetch(`${initialUrl}/login`, {
method: 'POST',
headers: {Accept: 'application/json', 'Content-Type': 'application/json'},
body: JSON.stringify(data)
});
let responseJson = await response.json();
console.log('Пришли такие данные с сервера', responseJson)
return responseJson;
} catch (e) {
console.log(`Ошибка на http ${e}`)
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question