Skip to content

Commit

Permalink
Fixed an error was being raised as pointed at insin#12 even if one fo…
Browse files Browse the repository at this point in the history
…llow the docs:

    Warning: Failed propType: Required prop `form` was not specified in `BootstrapForm`. Check the render method of `App`.

As far as I see the `required` of form is only used in order to guarantee it is used between a newforms.Form tag. But if you don`t pass it, an error is raised anyway:
   Uncaught TypeError: Cannot read property `__patchedByBootstrapForm` of undefined

So I removed the the "required" form property on propTypes and made a validation inside render.
  • Loading branch information
Ivens Rocha committed Jan 7, 2016
1 parent b40d543 commit ba907a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ var BootstrapForm = React.createClass({
},

propTypes: {
form: React.PropTypes.instanceOf(Form),
spinner: React.PropTypes.string
},

Expand Down

0 comments on commit ba907a7

Please sign in to comment.