Skip to content

Instantly share code, notes, and snippets.

@balanceiskey balanceiskey/esnextbin.md
Last active Feb 18, 2016

Embed
What would you like to do?
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<!-- put markup and other contents here -->
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
const React = require('react');
const ReactDOM = require('react-dom');
const SimpleTextarea = React.createClass({
getInitialState () {
return {
value: '',
};
},
_handleChange (ev) {
this.setState({value: ev.target.value});
},
render () {
return (
<textarea
onChange={this._handleChange}
placeholder="Some placeholder text"
value={this.state.value}
/>
);
}
});
ReactDOM.render(<SimpleTextarea />, document.body);
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"react": "0.14.7",
"react-dom": "0.14.7"
}
}
'use strict';
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
var React = require('react');
var ReactDOM = require('react-dom');
var SimpleTextarea = React.createClass({
displayName: 'SimpleTextarea',
getInitialState: function getInitialState() {
return {
value: ''
};
},
_handleChange: function _handleChange(ev) {
this.setState({ value: ev.target.value });
},
render: function render() {
return React.createElement('textarea', {
onChange: this._handleChange,
placeholder: 'Some placeholder text',
value: this.state.value
});
}
});
ReactDOM.render(React.createElement(SimpleTextarea, null), document.body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.