如何在开发过程中模拟状态

时间:2017-02-08 03:48:24

标签: reactjs redux redux-form

我在基于redux-form lib。

的表单组件上进行调试

但是,我每次都需要执行必需步骤才能到达step N

是否可以设置一些模拟状态以直接找到Step N

有什么想法和暗示吗?

inline

App.tsx

<SearchStructureBuilderForm
    structureList={this.props.dataReducer.structureList}
    tableList={this.props.dataReducer.tableList || []}
    parentProps={this.props}
    onSubmit={this.showResults.bind(this)}>
</SearchStructureBuilderForm>

SearchStructureBuilderForm.tsx

    render() {
        let {
            parentProps,
        } = this.props;                    

        ...
    }


    const mapStateToProps = (state: any) => {
    const formData = state.form[FORM_NAME] || {}
    const structureList = state.dataReducer.structureList
    const email = selector(state, 'email')
    const selectedTable = selector(state, 'selectedTable')
    const structureName = selector(state, 'structureName')
    return {
        formData,
        structureList,
        email,
        selectedTable,
        structureName,
    }
    }

    export default connect(
    mapStateToProps,
    mapDispatchToProps
    )(reduxForm(formOption)(SearchStructureBuilderForm as any))

1 个答案:

答案 0 :(得分:0)