Update forms.md (#8136)

The component Form in "Uncontrolled Radio Button" example doesn't need state, because it does not used in render() method.
This commit is contained in:
Yura Chuchola
2016-11-01 02:35:20 +02:00
committed by Kevin Lacker
parent 8a54f20ee1
commit 47215f9d06

View File

@@ -397,17 +397,17 @@ ReactDOM.render(
class Form extends React.Component {
constructor(props) {
super(props);
this.state = {value: 'B'};
this.value = 'B';
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleChange(event) {
this.setState({value: event.target.value});
this.value = event.target.value;
}
handleSubmit(event) {
alert('Radio button value is: ' + this.state.value);
alert('Radio button value is: ' + this.value);
}
render() {