Browse Source

Update forms.md (#8136)

The component Form in "Uncontrolled Radio Button" example doesn't need state, because it does not used in render() method.
main
Yura Chuchola 8 years ago
committed by Kevin Lacker
parent
commit
47215f9d06
  1. 6
      docs/forms.md

6
docs/forms.md

@ -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() {

Loading…
Cancel
Save