Closed thugcee closed 4 years ago
It's digging into not-really-public interfaces, but:
this.refs.form.refs.input.getValue()
does the trick
https://github.com/gcanti/tcomb-form/blob/master/GUIDE.md#validate
form.validate().value
works.
Thank you.
Version
Tell us which versions you are using:
Expected behaviour
Since there is Form.validate(), Form.getValue() should return a value without validation or provide a separate method to get a form value without validation.
This is required for all kinds of programmatic form filling based on user's selections in the form. For example, in some order form, one would like to copy customer's address to shipping address.
Actual behaviour
Form.getValue() returns null for invalid forms, thus forcing developer to read all fields values one by one using form.getComponent(path) to recreate form's state.
Or maybe there is already some other way to do this?
Steps to reproduce