react-utils-helper
Version:
A bunch of helper components for React
32 lines (25 loc) • 529 B
JSX
/**
* @jsx React.DOM
*/
;
var React = require('react');
var _ = require('lodash');
module.exports = React.createClass({
getDefaultProps: function(){
model: true
},
render: function(){
var child = this.props.children ? this.props.children : null;
var renderChildren = function(){
return _.map(child, function(val){
if(typeof(val) == "object")
return val.props.children;
else
return val;
});
}
return <div>
{this.props.model ? renderChildren() :null }
</div>
}
});