@samitouri / QOS-React / commits / abeae306e5

Update forms.md (#8136)

The component Form in "Uncontrolled Radio Button" example doesn't need state, because it does not used in render() method.

Yura Chuchola committed Nov 1, 2016 at 02:35 UTC abeae306e5eb53ec6354ff625f10b90aa79645ae
1 file changed +3 -3
docs/docs/forms.md
+3 -3
@@ -397,17 +397,17 @@ ReactDOM.render(
397 class Form extends React.Component {
398 constructor(props) {
399 super(props);
400 - this.state = {value: 'B'};
400 + this.value = 'B';
401 this.handleChange = this.handleChange.bind(this);
402 this.handleSubmit = this.handleSubmit.bind(this);
403 }
404
405 handleChange(event) {
406 - this.setState({value: event.target.value});
406 + this.value = event.target.value;
407 }
408
409 handleSubmit(event) {
410 - alert('Radio button value is: ' + this.state.value);
410 + alert('Radio button value is: ' + this.value);
411 }
412
413 render() {