react-validation
react-validation copied to clipboard
Warning: Input is changing an uncontrolled input of type undefined to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component.
<Validation.components.Form ref={c => { this.form = c }} onSubmit={this.handleSubmit.bind(this)}>
<div className="row justify-content-center">
<div className="form-inline">
<div className="input-group input-group-lg">
<Validation.components.Input
name="text"
onFocus={this.removeApiError}
errorClassName="is-invalid-input"
containerClassName=""
className="form-control"
validations={['required']}
placeholder="I need to do this...."
onChange={(event)=> this.setState({text:event.target.value})}
ref="text"/>
</div>
<div className="input-group date input-group-lg">
<input type="text"
className="form-control"
onChange={(event)=> this.setState({dueDate:event.target.value})}
ref="date"/>
<span className="input-group-addon"><i className="glyphicon glyphicon-th"></i></span>
</div>
</div>
</div><br/>
<div className="row justify-content-center">
<div className="col-md-2">
<Validation.components.Button
className="btn btn-primary btn-block"
onClick={()=>this.addReminder()}>
Add this
</Validation.components.Button>
</div>
</div><br/>
<div className="row justify-content-center">
{this.renderReminders()}
</div>
</Validation.components.Form>
You need to specify the value props to prevent this error.
Is not possible to use an uncontrolled input?