reduxForm({
form: 'theFormName',
enableReinitialize: true,
}),
const mapStateToProps = (state, ownProps) => ({
initialValues: {
fieldName: ownProps.certainFieldValue
}
})
- Redux form official doc: https://www.google.com/search?q=redux+form+initialValue+with+props&ie=utf-8&oe=utf-8
- Use props in mapStateToProps: reduxjs/redux#693
- Connect detail: https://kknews.cc/zh-tw/other/kva5nv.html
- Discuss 1: reduxjs/redux#693
- Discuss 2: redux-form/redux-form#837
Use normalize: https://redux-form.com/6.0.0-rc.1/examples/normalizing/