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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -