Skip to content

Instantly share code, notes, and snippets.

@VitorRibeiroCustodio
Created August 17, 2020 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VitorRibeiroCustodio/b7ed80c047c9480796b0d3bda9a6f91d to your computer and use it in GitHub Desktop.
Save VitorRibeiroCustodio/b7ed80c047c9480796b0d3bda9a6f91d to your computer and use it in GitHub Desktop.
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