var FormField = React.createClass({ _fieldRequiredText: 'This field is required', _type: null, _element: null, propTypes: { type: React.PropTypes.string.isRequired, hidden: React.PropTypes.bool, }, getInitialState: function() { return { adviceState: 'hidden', adviceText: null, } }, componentWillMount: function() { if (['text', 'radio', 'checkbox', 'file'].indexOf(this.props.type) != -1) { this._element = 'input'; this._type = this.props.type; } else { // Non field, e.g.