Skip to content

Instantly share code, notes, and snippets.

@manoelneto
Created August 8, 2018 12:48
Show Gist options
  • Save manoelneto/172be26b2c3c6bcf24bd0eaef3de1061 to your computer and use it in GitHub Desktop.
Save manoelneto/172be26b2c3c6bcf24bd0eaef3de1061 to your computer and use it in GitHub Desktop.
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