React native-对象作为React子对象无效(找到:带有键{A,B,C,D}的对象)

时间:2018-09-12 10:21:31

标签: javascript android reactjs react-native react-native-android

我正试图了解管理层在本机工作中如何休息……我复制了当前情况:

  

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响应此结构:

enter image description here

错误是这样的:

enter image description here

如何在键ORD01,ORD02,ORD03,FAM00,PEN00下恢复某些值(“类别”和“计划”)?

非常感谢!

0 个答案:

没有答案