var React = require('react'); var Classable = require('../../../../node_modules/material-ui/src/js/mixins/classable'); var EnhancedTextarea = React.createClass({ mixins: [Classable], propTypes: { onChange: React.PropTypes.func, onHeightChange: React.PropTypes.func, textareaClassName: React.PropTypes.string, rows: React.PropTypes.number }, getDefaultProps: function() { return { rows: 1 }; }, getInitialState: function() { return { height: this.props.rows * 24 }; }, componentDidMount: function() { this._syncHeightWithShadow(); }, render: function() { var { className, onChange, onHeightChange, textareaClassName, rows, valueLink, ...other, } = this.props; var classes = this.getClasses('mui-enhanced-textarea'); var textareaClassName = 'mui-enhanced-textarea-input'; var style = { height: this.state.height + 'px' }; if (this.props.textareaClassName) { textareaClassName += ' ' + this.props.textareaClassName; } if (this.props.hasOwnProperty('valueLink')) { other.value = this.props.valueLink.value; } return (