react-validation icon indicating copy to clipboard operation
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.

Open yash2code opened this issue 8 years ago • 2 comments

<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>

yash2code avatar Jun 08 '17 03:06 yash2code

You need to specify the value props to prevent this error.

ghost avatar Jun 21 '17 08:06 ghost

Is not possible to use an uncontrolled input?

nathantn avatar Sep 27 '17 13:09 nathantn