【发布时间】:2019-04-05 03:23:46
【问题描述】:
我在 react native 中使用 fetch 并有一条消息:'fetch' is not defined.eslint(no-undef)
我的代码:
getData() {
fetch('https://tutorialzine.com/misc/files/example.json', {})
.then(res => res.json())
.then((res) => {
console.log(res);
}).catch((e) => {
console.log(e);
});
}
我该如何解决?并且 console.log 不显示数据
【问题讨论】:
标签: react-native fetch