【发布时间】:2016-11-13 19:35:40
【问题描述】:
我有一个反应原生的功能
_onPressButtonGET: function() {
fetch("https://newsapi.org/v1/articles?source=techcrunch&apiKey=[YOUR_API_KEY]", {method: "GET"})
.then((response) => response.json())
.then((responseData) => {
// AlertIOS.alert(
// "Latest Story: TechCrunch",
// "" + responseData.articles[0].title
// )
responseData.articles[0].title
})
.done();
},
我正在尝试在组件中获取文章标题,但在这样做时遇到了麻烦。我怎样才能做到这一点?谢谢!
【问题讨论】:
标签: json react-native