I want to add or remove an attribute from an html input element.
What i'm done is this:
constructor(props) {
super(props);
this.state = {inputState: 'readOnly'};
}
And the render function:
<input className="form-control" type="text" value={floor} {...this.state.inputState} />
As you can see i want set the "readOnly" attribute on the input element. But now i get an error which says:
Unknown props
0,1,2,3,4,5,6,7on tag. Remove these props from the element
When an user is clicking on the input element it should become editable, so i want to dynamicly change this attribute.
But how can i do that?
<input className="form-control" type="text" value={floor} {...this.state} />