Load More为组件中的渲染Redux字段调度一个函数错误字段未定义

时间:2019-11-25 08:34:23

标签: javascript reactjs redux react-redux redux-form

我想在单击loadMore之后以redux形式分派一个函数,我已经从API提取了数据,我只需要一次渲染记录切片。

const mapDispatchToProps = (dispatch) => {
    return {
        loadMore: (value) => {
            dispatch(value);
        },
}}

loadMore = () => {
        this.setState({
            pageNo: this.state.pageNo + 2,
        }, () => {
            setTimeout(() => {
                console.log(this.props);
                this.props.loadMore(this.getData())
            }, 200);
        });
    }

<FieldArray name="getData"
                        component={this.getData}
                    />


getData= ({ fields, meta: { error, submitFailed } }) => {
        let fetchFields = fields.getAll();

        let displayFetchedFields = fetchFields.slice(0, this.state.pageNo);
        if (displayFetchedFields) {
            return displayFetchedFields.map((facility, index) => {
}
}}

点击加载更多错误之后:get.js:63 Uncaught TypeError:无法读取未定义的属性“字段”

0 个答案:

没有答案