diff --git a/src/index.jsx b/src/index.jsx index 3ef2bdc..769c23f 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -184,7 +184,6 @@ var BootstrapForm = React.createClass({ }, propTypes: { - form: React.PropTypes.instanceOf(Form).isRequired, spinner: React.PropTypes.string }, @@ -194,11 +193,17 @@ var BootstrapForm = React.createClass({ } }, - render() { - patchForm(this.props.form) - return
- {this.renderRows()} -
+ render:function() { + if (this.props.form === undefined) { + console.error("Warning newforms-bootstrap requires to be passed between newforms.Form tags."); + return React.createElement("div", null, null); + } + else { + patchForm(this.props.form) + return React.createElement("div", null, + this.renderRows() + ) + } }, renderRows() {