I have the next constructor in a React Component
constructor(props){
super(props);
this.state = {
socket:null,
state:'main',
match:{
creationDate:'',
host:'',
players:[]
},
name1:'',
name2:'',
}
Then I define an Input like this:
<Input style={{width: 100 + '%'}} readOnly value={this.state.match.host}></Input>
And I am getting the next Warning: Warning: A component is changing an uncontrolled input of type text 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.
As far as I know it's just needed to define the initial value of the variable state as I did.
Thanks for the help.
Inputelement look like? Where does it come from? - Donovan Hiland