JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://fb.me/react-with-addons-0.12.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.12.0.js"></script>
<script src="http://fb.me/react-js-fiddle-integration.js"></script>
<html>
<body>
</body>
</html>
JavaScript 1.7
var OreTextArea = React.createClass({
getInitialState: function() {
return {
textAreaValue: "initial value"
};
},
onChangeText: function(e) {
this.setState({textAreaValue: e.target.value});
},
onClick: function() {
this.setState({textAreaValue: this.refs.textArea.getDOMNode().value});
},
render: function() {
return (
<div>
<div>{this.state.textAreaValue}</div>
<div>
<textarea value={this.state.textAreaValue} onChange={this.onChangeText} />
</div>
<div>
<textarea ref="textArea">this is default value</textarea>
<button onClick={this.onClick}>change</button>
</div>
</div>
);
}
});
React.render(<OreTextArea />, document.body);