Closed staminaloops closed 8 years ago
Hi,
The problem seems in the caracteristicsLayout
function:
var caracteristicsLayout = function(locals){
// missing return...
chunk.map(function(result, index){
return(
<div key={index} className='col-md-4'>
{ result.map (function(r, i) {
// locals.inputs[r]
return(<div key={i}>{locals.inputs.r}</div>)
}) }
</div>
)
})
}
This works for me:
var caracteristicsLayout = function(locals){
return (
<div>
{
chunk.map(function(result, index){
return (
<div key={index} className='col-md-4'>
{result.map(function(r, i) {
return (<div key={i}>{locals.inputs[r]}</div>);
})}
</div>
);
})
}
</div>
);
};
It's one of those cases where a second pair of eyes comes and you say duh. Thank you for your help and thank you for this great project.
I really like this project. Since I didnt want to write a template for each form, I'm trying to write a template that I can use to all forms, dividing the fields for 3 bootstrap columns.
I try this, but I get an error: Error: Invariant Violation: Struct.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.
I just started using tcomb forms, so maybe I'm doing something very wrong. Any thoughts? Thanks :)
Edit: I'm using React 0.13 and tcomb-form: ^0.6.9