Created
August 17, 2020 20:03
-
-
Save VitorRibeiroCustodio/b7ed80c047c9480796b0d3bda9a6f91d 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'; | |
import 'draft-js/dist/Draft.css'; | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = {editorState: EditorState.createEmpty()}; | |
this.onChange = editorState => this.setState({editorState}); | |
} | |
render() { | |
return ( | |
<Editor editorState={this.state.editorState} onChange={this.onChange} /> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment