From ba907a788fc3322c1533546ec5188b6120d8128c Mon Sep 17 00:00:00 2001 From: Ivens Rocha Date: Thu, 7 Jan 2016 11:55:27 -0200 Subject: [PATCH] Fixed an error was being raised as pointed at #12 even if one follow 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. --- src/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.jsx b/src/index.jsx index 769c23f..f8a82bc 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -184,6 +184,7 @@ var BootstrapForm = React.createClass({ }, propTypes: { + form: React.PropTypes.instanceOf(Form), spinner: React.PropTypes.string },