redux-form
was designed with the idea that your data will be stored on the server when submitted.
However, you have nothing to put your own .then()
clause after checking async for this. Something like that?
// async function you already have that is looking at your // picture field and rejecting the promise with errors import validateDimensions from './validateDimensions' // async function to upload the image import upload from './uploadImage' const MyForm = reduxForm({ form: 'myForm', asyncValidate: values => validateDimensions() .then(() => { // we know validation passed upload(values.prettyPicture) // ^ not "return upload(values.prettyPicture)" to let this async // validation promise resolve and do upload asynchronously // after it has resolved }) }, asyncBlurFields: [ 'prettyPicture' ] })(MyForm)
source share