var React = require('react'); var _ = require('lodash'); var cx = require('classnames'); var TextInput = React.createClass({ getDefaultProps: function() { return { data : {}, defaultValue : '', onChange : function(){}, id : 'textInput', label : '', }; }, id : function(){ return _.snakeCase(this.props.label) || this.props.id; }, data : function(){ return this.props.data[this.id()] || this.props.defaultValue; }, handleChange : function(e){ this.props.onChange({ [this.id()] : e.target.value }); }, renderLabel : function(){ if(!this.props.label) return; return }, render : function(){ return