пытается использовать fetch в реакции на натив и получает
Unable to symbolicate stack trace: Requiring module "node_modules\react-native\Libraries\Network\fetch.js", which threw an exception: TypeError: Attempted to assign to readonly property.
Unable to symbolicate stack trace: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[5], "../../Network/fetch").fetch')
Вот мой код
Это первый экран приложения
import React, {Component} from 'react';
import {Text, View} from 'react-native';
export default class App extends Component {
state = {
loginURL:''
};
componentDidMount(): void {
fetch('http://10.0.2.2:4607/imgur/login', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
})
.then((response) => response.json())
.then((json) => {
if(json.type === 'redirect') this.setState({'loginURL': json.data});
});
};
render(){
return (<View><Text>Hello</Text></View>);
};
}
Я имею попытался удалить каталог node_modules и заново запустить npm install
, но та же проблема. На симуляторе
Мой пакет. json Зависимости:
"dependencies": {
"@fortawesome/fontawesome-pro": "^5.13.0",
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/pro-light-svg-icons": "^5.13.0",
"@fortawesome/pro-regular-svg-icons": "^5.13.0",
"@fortawesome/pro-solid-svg-icons": "^5.13.0",
"@fortawesome/react-native-fontawesome": "^0.2.3",
"@react-native-community/masked-view": "^0.1.7",
"@react-navigation/drawer": "^5.3.4",
"@react-navigation/native": "^5.1.3",
"appcenter": "3.0.0",
"appcenter-analytics": "3.0.0",
"appcenter-crashes": "3.0.0",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-gesture-handler": "^1.6.1",
"react-native-reanimated": "^1.7.1",
"react-native-render-html": "^4.2.0",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.4.0",
"react-native-svg": "^11.0.1",
"react-native-vector-icons": "^6.6.0",
"react-native-webview": "^8.2.1",
"react-navigation": "^4.3.3"
},