Last active
September 28, 2016 02:45
-
-
Save RaoHai/d159683eaa7e074ff30a270405922546 to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import { Editor, EditorState } from 'draft-js'; | |
export default class EditorCore extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { editorState: EditorState.createEmpty() }; | |
this.onChange = this._onChange.bind(this); | |
} | |
_onChange(editorState) { | |
this.setState({ editorState }); | |
} | |
render() { | |
const { editorState } = this.state; | |
return (<div className="MediumEditor-root"> | |
<Editor | |
placeholder="Tell your story..." | |
editorState={editorState} | |
onChange={this.onChange} | |
/> | |
</div>); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment