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

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -