javascript - Using a ReactJS prop as the validator in Redux Form -


how tell react take constraints prop passed tologinform parent?

export default reduxform({   form: 'loginform',   validate: formvalidator(constraints) })(loginform) 

in above working code, constraints not declared outside of react components.

validate can passed form prop instead of reduxform config. you'd pass when instantiate:

<loginform validate={formvalidator(constraints)} />

http://redux-form.com/7.0.3/docs/api/reduxform.md/


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -