Last active
March 5, 2016 18:44
-
-
Save marawannwh/c6aabbb7a3d21a1dfade to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var React = require('react'); | |
var Editor = require('draft-js').Editor; | |
var EditorState = require('draft-js').EditorState; | |
var MyEditor = React.createClass({ | |
getInitialState: function() { | |
return {editorState: EditorState.createEmpty()}; | |
}, | |
onChange: function(editorState) { | |
this.setState({editorState}) | |
}, | |
render: function() { | |
editorState = this.state | |
return ( | |
<Editor editorState={editorState} onChange={this.onChange} /> | |
) | |
}, | |
}); | |
module.exports = MyEditor; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment