1
我正在調試基於redux-form
庫的表單組件。如何在開發過程中模擬狀態
不過,我需要經過的步驟,需要每達到一次step N
是否可以設置一些模擬狀態來定位我到Step N
直接?
任何想法和提示?
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))