我正试图了解管理层在本机工作中如何休息……我复制了当前情况:
HomeScreen.js
export default class Home extends React.Component {
constructor(props) {
super(props);
this.state = { loading: true };
}
componentDidMount() {
this.handleBackPress();
this.setState({
loading: true,
});
console.log('url');
return fetch('url')
.then(response => response.json())
.then(responseJson => {
this.setState(
{
loading: false,
dataSource: responseJson.response,
},
function() {},
);
})
.catch(error => {
console.error(error);
});
}
render() {
return (
<Container style={styles.container}>
<Content padder>
<Loader loading={this.state.loading} />
<View style={styles.lineStyle} />
//I want to see what's in here
{this.state.dataSource}
<FlatList
data={this.state.dataSource}
renderItem={({ item }) => (
<Text uppercase={false} style={styles.TextStyleWhite}>
{item}
</Text>
)}
keyExtractor={(item, index) => index}
/>
</Content>
</Container>
);
}
}
URL响应此结构:
错误是这样的:
如何在键ORD01,ORD02,ORD03,FAM00,PEN00下恢复某些值(“类别”和“计划”)?
非常感谢!