【发布时间】:2019-09-30 22:07:52
【问题描述】:
我是 react-native 的新手。我需要将我的 JSON 显示到我的 react native 主页中,但我不知道该怎么做。你有什么建议,尤其是 Json 文件很长。我想在替代列表视图中仅显示 "s_title":"hjkjhjk","s_description":"jnkmjhnkl"
JSON
Array [
Object {
"fk_c_locale_code": "en_US",
"fk_i_item_id": 3,
"s_description": "jnkmjhnkl",
"s_title": "hjkjhjk",
},
我的主要 React-Native 页面如下,我需要它从 Json 文件中读取:
import {
Button,
Alert
}
HomeScreen.navigationOptions = {
header: null,
};
function test(){
fetch('http://***:3000/users')
.then(response => response.json())
.then(users => console.warn(users));
//Alert.alert(response);
}
【问题讨论】:
标签: mysql json react-native parsing