davidkpiano / react-redux-form

Create forms easily in React with Redux.
https://davidkpiano.github.io/react-redux-form
MIT License
2.07k stars 251 forks source link

Using valid and invalid attributes from reactstrap Input component with Control component in form validation #1227

Closed ahmedxgouda closed 4 years ago

ahmedxgouda commented 4 years ago

I love using react-redux-form instead create my own react controlled form, it saves me from bunch of pain, but I can't use solve this mystery. So, this is how it looks when using Input component from 'react-strap': <Input type="text" name="username" id="username" valid={errors !== undefined && this.state.touched.username ? errors.username === '' : null} invalid={errors !== undefined ? errors.username !== '' : null} /> and this is how it looks in the Control Component: <Control.text model=".firstname" className="form-control" id="firstname" name="firstname" placeholder="First Name" validators={{ required, minLength: minLength(3), maxLength: maxLength(8), validName }}/> I want to pass 'valid' and 'invalid' attributes to the Control Component and I can't find a way to do it.