made with esnextbin
Last active
February 18, 2016 16:41
-
-
Save balanceiskey/34f91098a980bef3788c to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
"react": "0.14.7", | |
"react-dom": "0.14.7" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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