react-utils-helper
Version:
A bunch of helper components for React
32 lines (25 loc) • 572 B
JavaScript
/**
* @jsx React.DOM
*/
;
var React = require('react');
var _ = require('lodash');
module.exports = React.createClass({displayName: "exports",
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 React.createElement("div", null,
this.props.model ? renderChildren() :null
)
}
});