1
redux-form
libに基づくフォームコンポーネントでデバッグしています。開発中に状態を模擬する方法
しかし、私が通過する必要が手順を実行する必要が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))