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 -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

Python Tornado package error when running server -