Guest User

Untitled

a guest
May 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. // ...
  2. _onClick = (e) => {
  3. this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, e.target.name));
  4. }
  5. render() {
  6. const styles = ['BOLD', 'ITALIC', 'UNDERLINE', 'CODE'];
  7. const buttons = styles.map(style => {
  8. return <button key={style} onClick={this._onClick} name={style}>{style}</button>
  9. })
  10. return (
  11. <div className="App">
  12. <h1>My Editor</h1>
  13. <div className='toolbar'>
  14. {buttons}
  15. </div>
  16. //...
  17. </div>
  18. )
  19. };
Add Comment
Please, Sign In to add comment