7

I've created a form using Ant design's Form.create() and i want to access it's field's values in another component. Using redux, i can do that using:

function mapStateToProps(state) {
  return {
    formStates: getFormValues('form')(state), 
  };
}

is there a way to do that for Ant design's Forms?

Taha Moumen
  • 79
  • 1
  • 2

1 Answers1

1

It can get the field values if the other component is inside Form.create().

Once the field has been registered with getFieldDecorator, you can access the value by props.form.getFieldValue('fieldName').

Yu Chia Wu
  • 876
  • 12
  • 14