var SectionWrapper = React.createClass({displayName: "SectionWrapper",
render: function() {
var level = this.props.path.length;
var classes = [].concat('form-section',
(level > 0 ? 'form-subsection' : []),
this.props.classes || []);
var legendClasses = [].concat(errorClass(this.props.errors) || [], //< HERE
'form-section-title');
this.props looks like this:
children: Array[1]
classes: undefined
description: "Declarative pure data DSLs are the best."
errors: undefined
path: Array[0]
title: "My pretty form"
My code: (h is just a helper function for React.createElement)
// in the render
h(Form, {
schema: {
title : "My pretty form",
description: "Declarative pure data DSLs are the best.",
type : "object",
properties : {
comment: {
title : "Your comment",
description: "Type something here.",
type : "string",
minLength : 1,
}
}
},
validate: validate,
onSubmit: this.handleSubmit
})
Simply adding an errors prop on the form doesn't really do anything. Where does that prop come from and why is mine undefined in the minimal examples as well as others I have tried? Am I missing something?
This has been fixed in master a while ago. I just released version 0.1.3 which includes the fix, so hopefully this will be the last we see of this issue.
I am trying to use the minimal example going in one of my projects, but am getting
Uncaught TypeError: Cannot read property 'length' of undefined Here:
Which is getting called from here:
this.props looks like this:
My code: (h is just a helper function for React.createElement)
Simply adding an errors prop on the form doesn't really do anything. Where does that prop come from and why is mine undefined in the minimal examples as well as others I have tried? Am I missing something?