i tried to only use my props for my input values - no controlled components by the internal state. its working i guess but i get the following error:
warning.js:33 Warning: ComponentXXX 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.
heres my code:
input:
<input type="radio" name="answer" value="ValueType1"
checked={this.props.valueType === "ValueType1"}
onChange={this.handleValueTypeChange}/>
interface:
declare interface Manager1 {
valueType: string;
}
change function:
private handleValueTypeChange(event: any) {
this.props.onUpdateMethod({
...this.props.manager {
valueType: event.target.value,
}
});
}
any ideas?