Created
August 8, 2018 12:48
-
-
Save manoelneto/172be26b2c3c6bcf24bd0eaef3de1061 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 ReactDOM from 'react-dom'; | |
import {Editor, EditorState} from 'draft-js'; | |
class App extends React.Component { | |
state = { | |
editorState: EditorState.createEmpty() | |
} | |
onChange = editorState => this.setState({editorState}) | |
render() { | |
return ( | |
<Editor editorState={this.state.editorState} onChange={this.onChange} /> | |
); | |
} | |
} | |
ReactDOM.render( | |
<App />, | |
document.getElementById('container') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment