We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
propTypes
1 parent 000b4e2 commit a15b7d3Copy full SHA for a15b7d3
public/scripts/tutorial20.js
@@ -41,6 +41,9 @@ var CommentForm = React.createClass({
41
author: '',
42
text: ''
43
},
44
+ propTypes: {
45
+ onCommentSubmit: React.PropTypes.func.isRequired
46
+ },
47
getInitialState: function () {
48
return _.clone(this.initialState);
49
@@ -63,12 +66,6 @@ var CommentForm = React.createClass({
63
66
this.setState(this.getInitialState());
64
67
}
65
68
- componentDidMount: function () {
- // check if required properties have been set
- if (!this.props.onCommentSubmit) {
69
- throw new Error('onCommentSubmit property not set');
70
- }
71
- },
72
render: function () {
73
return (
74
<form
0 commit comments