daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Nov 14th, 2018 77 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. validateSchema = (values: Object) => {
  2.     try {
  3.       this.props.validationSchema && this.props.validationSchema.validateSync(values, {abortEarly: false});
  4.       return {};
  5.     } catch (e) {
  6.       return e.inner.reduce((errors, error) => {
  7.         return setIn(errors, error.path, error.message);
  8.       }, {});
  9.     }
  10.   };
  11.  
  12.   render() {
  13.     const {initialValues, onSubmit, validateOnBlur, subscription, render, validationSchema, ...props} = this.props;
  14.     const validate = validationSchema ? this.validateSchema : undefined;
  15.  
  16.     return (
  17.       <FinalForm
  18.         initialValues={initialValues}
  19.         onSubmit={onSubmit}
  20.         validate={validate}
  21.         validateOnBlur={validateOnBlur}
  22.         subscription={subscription}
  23.         render={render}
  24.         {...props}
  25.       />
  26.     );
  27.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top