L
L
lexstile2018-12-14 12:09:25
redux
lexstile, 2018-12-14 12:09:25

How to add new value to FormSection in redux-form?

one.

const formValues = (state: ApplicationState) => getFormValues('valuationReport')(state); // форма (не имеет своего FormSection)

const formSelector = createSelector(
  formValues,
  (values: Object) => get(values, 'reporterCompany'), // создаем селектор для секции формы
);

2.
const mapDispatchToProps = {
  changeField: (field, value) => (dispatch) => {
    dispatch(change('valuationReport.reporterCompany', field, value)); // прокидываю ф-цию в пропсы компонента
  },
};

export const LienPageValuationReportController = compose(
  connect(
    mapStateToProps, mapDispatchToProps
  ),
  reduxForm({
    form: 'valuationReport',
    destroyOnUnmount: false,
  }),
)(LienPageValuationReportContainer);

https://dropmefiles.com/3WS99
How do I add my data here via the CHANGE method (now available in props) from the redux-form box?
The problem is that I don't know how to access the form...
When there was one FormSection (no nested ones), everything worked, now it doesn't.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question